|
|
|
|
|
by signa11
1041 days ago
|
|
> Serialization and parsing are security minefields and it is dangerously naive to just hand-wave that away.
well, i am not hand-waving them away, i am not sure what can the serialization framework possibly _do_ to make things secure during the serialization ? when execution of user-supplied code is allowed (in the examples that you have outlined above), surely, the layer _executing_ the code cannot really do anything about it ! perhaps you actually did intend to `rm -rf /` ? policy checking, enforcement etc. has to happen at a higher / different layer. i am not sure why mechanism and policy are being conflated here. in the same way, you gave the serialization layer a 10mb or whatever sized input to serialize, sure...you get an valid serialized output etc. maybe there is a genuine usecase for that in some context or another f.e. when serializing say image files, or something else etc. etc. [edit] : minor comment. |
|
Loads of things!
A strict specification that can only be interpreted one way goes very far. E.g.: a machine-readable BNF grammar file or something similar with no ambiguities.
A conformance test suite covering corner-cases is surprisingly effective, even with a supposedly perfect spec.
"Be strict with what you generate and lax with what you accept" has been demonstrated over and over again to be a disaster over the long-term in an ecosystem of many groups. Be strict always with what is accepted, not just generated!
Speaking of being strict: schema validation is essential. Strong typing for scalars helps a lot.
The actual implementations of the spec can obviously have a wide range of security features. Never allowing arbitrary type instantiation is critical, yet is a mistake that keeps reoccurring much like SQL injection.
Etc, etc...