-
-
Notifications
You must be signed in to change notification settings - Fork 490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deserialize is not sound for VecStorage (and possibly others) #883
Comments
Unfortunately I don't have the bandwidth to address this myself at the moment, but it seems to me that we should try to fix this sooner rather than later. Is there anyone who would be interested in taking this on? I'd be happy to assist/mentor and review code. In addition to a custom |
I will take care of this next week. |
VecStorage
currently looks like this:VecStorage
carries an implicit invariant in thatnrows * ncols == data.len()
, and I believe there is some unsafe code that relies on this invariant. However, sinceDeserialize
is derived, it does not know about this invariant. Therefore it is possible to break this invariant in safe code by deserializing invalid data. This is a potential security issue, since a malicious attacker might potentially use this to read/write to invalid memory locations.In order to fix this, we should write a custom
Deserialize
implementation that validates the input.There may also be other soundness issues caused by invariants not being upheld by derived
Deserialize
implementations throughout the library.The text was updated successfully, but these errors were encountered: