4 ms·
I'd file that under "weird stuff you can do with the deserialized object", and static types certainly don't protect you from that (edit: or from dangerous seria
by lolinder 4y ago
I'd file that under "weird stuff you can do with the deserialized object", and static types certainly don't protect you from that (edit: or from dangerous serializer libraries).
This bug isn't in that category, though: this happened because GitLab assumed they had a specific data type but didn't guarantee that this was always true. The build_command method, in turn, does something different depending on the type of data passed into it.
This line in the Ruby code:
id = id_for_already_imported_cache(object)
Would translate to this in the Java code:
Object id = idForAlreadyImportedCache(object)
Which would immediately set off alarm bells in the mind of the author that they should probably double-check they've got the right type.