apollographql / apollo-rs

Spec compliant GraphQL Tools in Rust.
Apache License 2.0
566 stars 45 forks source link

Apply recursion limit in validation #742

Closed goto-bus-stop closed 9 months ago

goto-bus-stop commented 10 months ago

The parser has a recursion limit to prevent stack overflows on deeply nested selection sets. Validation has recursion breaks for things that may circularly reference each other. But if you build a chain of thousands of named things that reference each other, you may theoretically be able to cause a stack overflow before the recursion break triggers (before it references back to the original definition).

qwerdenkerXD commented 10 months ago

You're right, here is it.