4 ms·
Writers should produce sorted maps, readers need to accept unsorted maps. It's a security issue, not just convenience. With unsorted maps the internal hash see
by rurban 7y ago
Writers should produce sorted maps, readers need to accept unsorted maps.
It's a security issue, not just convenience. With unsorted maps the internal hash seed can be exposed, together with timing information.
Another famous omission from the specs.
- AgentOrange1234 7y agoI’m no security expert. How is “exposing the hash seed” a problem for the vast majority of applications? What timing information would be leaked and why would that be problem? On the other hand, accepting unsorted maps seems like it could introduce covert channels?
- j88439h84 7y agohttps://bugzilla.redhat.com/show_bug.cgi?id=750555 https://bugzilla.redhat.com/show_bug.cgi?id=750555 This led to hash randomization on by default since Python 3.3.
- AgentOrange1234 7y agoCool. Thanks.
- rurban 7y ago> How is “exposing the hash seed” a problem for the vast majority of applications? They can be DOS'ed. > What timing information would be leaked and why would that be problem? You misunderstood. By 1. leaking the order, and 2. by checking the timing of getting certain keys of a map you do have two independent infos to get at the secret seed. > accepting unsorted maps seems like it could introduce covert channels? A covert channel might be exposed by the sender, if he uses some non-random but unsorted map order. The receiver needs to accept any order. There's no risk in accepting unsorted maps. The only risk at the receiver side is another famous omission from the spec: How to deal with duplicate keys. Accept (overwrite or drop) or reject? All 3 cases can be seen in the wild.