-
Notifications
You must be signed in to change notification settings - Fork 0
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
Missing validation around ObjectId and LibraryId #5
Comments
This was my initial assumption, but it turned out that ObjectIds that are referenced by other objects can be negative ;) SafePayloadReader/System.Runtime.Serialization.BinaryFormat/SafePayloadReader.cs Lines 191 to 194 in cfb7ac5
I've hit that case when implementing some more sophisticated test. I'll carefully study the spec for each record type and add the validation |
If an object with given Id has been already recorded, the SafePayloadReader/System.Runtime.Serialization.BinaryFormat/SafePayloadReader.cs Lines 196 to 197 in cfb7ac5
I need to write tests for invalid inputs to have it covered. |
According to the MS-NRBF spec, ObjectId and LibraryId values must be positive 32-bit integers. Currently these values are read with no validation.
Additionally, the current behavior for the reader is that if it encounters multiple objects / libraries with the same id in the serialization stream, any records which appear later in the stream override records which appear earlier in the stream. This is an example of an opinionated behavior. Is this intentional? What are the consequences of allowing this?
The text was updated successfully, but these errors were encountered: