Skip to content

Detect dangerous reference changes in TryDeserialize()#171

Open
francoisvn wants to merge 1 commit intojacobdufault:masterfrom
francoisvn:detect-dangerous-deserialization
Open

Detect dangerous reference changes in TryDeserialize()#171
francoisvn wants to merge 1 commit intojacobdufault:masterfrom
francoisvn:detect-dangerous-deserialization

Conversation

@francoisvn
Copy link
Copy Markdown

It's easy to accidentally do something like instance = new Thing() in TryDeserialize(), but that can break silently if you have any cyclic references. This will try to detect that and complain.

Should this be a warning instead of failure? If there are any cyclic references then it could be a nasty silent failure, but if not then there's no issue. Only doing the detection if IsObjectDetection() would severely limit the coverage of this test, but maybe that could determine warning vs failure? Feels like I might be overthinking, so submitting this for now.

Maybe a kinder soul will write a unit test for this. Not sure I'm that soul

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant