Skip to content

Security - Unbounded recursion in deserialization #1109

Description

@EdwardCooke

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.

using System;
using YamlDotNet.Serialization;

string yaml = new string('[', 100_000);              // deeply nested flow sequences
try
{
    new Deserializer().Deserialize<object>(yaml);    // crashes with StackOverflowException
}
catch (Exception)
{
    // never reached: a StackOverflowException is uncatchable and kills the process
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions