You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Security - Unbounded recursion in deserialization #1109
There is an unbounded security vulnerability in the default serializer.
Thanks to Igor to finding it.
Using the following code you will get a stack overflow exception.
usingSystem;usingYamlDotNet.Serialization;stringyaml=newstring('[',100_000);// deeply nested flow sequencestry{newDeserializer().Deserialize<object>(yaml);// crashes with StackOverflowException}catch(Exception){// never reached: a StackOverflowException is uncatchable and kills the process}
This is now fixed, the default max recursion using the deserializer and deserializerbuilder is 475. Using the default serializer that is the maximum that will not throw an exception during testing.
Looks like Windows handles exceptions differently than Linux. The exceptions are placed on the stack, very interesting. This made the limit in tests for Windows actually bee 152 so that is what I set the default to.
Activity
EdwardCooke commentedon Jun 21, 2026
This is now fixed, the default max recursion using the deserializer and deserializerbuilder is 475. Using the default serializer that is the maximum that will not throw an exception during testing.
EdwardCooke commentedon Jun 21, 2026
Looks like Windows handles exceptions differently than Linux. The exceptions are placed on the stack, very interesting. This made the limit in tests for Windows actually bee 152 so that is what I set the default to.