EQUAL? tests hidden values #1778
Labels
Datatype: object!
Oldes.resolved
Bugs/wishes with Oldes' fixes/features
Protection
Status.important
Test.written
Type.bug
Submitted by: mikerev
EQUAL? should ignore hidden values, otherwise you can determine the value by brute force testing. Equality functions should not consider the value or names of hidden fields.
Imported from: CureCode [ Version: alpha 110 Type: Bug Platform: All Category: Security Reproduce: Always Fixed-in:none ]
Imported from: metaeducation#1778
Comments:
Submitted by: Sunanda
Nice catch.
I'd agree -- FALSE is better; better still may be a "can't compare objects with hidden fields" error.
The current behaviour allows the value of 'a to be recovered:
In real life it may not be so simple (especially if there were more hidden variables, and 'a were not an integer), but it should not be possible at all.
Submitted by: BrianH
It's a security issue. A lot of contexts will have hidden fields so we shouldn't just refuse to compare the whole context, but we should follow the general pattern of pretending that the fields don't exist, at least for comparison purposes. Ticket tweaked accordingly, and more examples added.
We might want them to consider whether a hidden field (or whatever name) is there, or we might want to pretend the hidden fields are not there at all. If we ignore the existence of hidden fields altogether then you will get objects that are equal even though their lengths are not - this might be acceptable. If we allow the existence of hidden fields to matter to the equality functions, then we might consider whether to ignore their position in the object, since that doesn't really matter. Whichever seems the most appropriate.
The text was updated successfully, but these errors were encountered: