serde-rs / serde-rs.github.io

https://serde.rs
Creative Commons Attribution Share Alike 4.0 International
22 stars 96 forks source link

security note for deriving Deserialize on types with invariants #74

Open birkenfeld opened 6 years ago

birkenfeld commented 6 years ago

When deriving Deserialize, it should be ensured that invariants of the types cannot be violated by deserializing untrusted data. This is especially important if the invariants are trusted by unsafe code. I checked but couldn't find such a note in the docs currently.