Описание
Juniper is vulnerable to @DOS GraphQL Nested Fragments overflow
GraphQL behaviour
Nested fragment in GraphQL might be quite hard to handle depending on the implementation language. Some language support natively a max recursion depth. However, on most compiled languages, you should add a threshold of recursion.
POC TLDR
With max_size being the number of nested fragment generated. At max_size=7500, it should instantly raise:

However, with a lower size, you will overflow the memory after some iterations.
Reproduction steps (Juniper)
Save this POC as poc.py
Credits
@c3b5aw @MdotTIM @karimhreda
Ссылки
- https://github.com/graphql-rust/juniper/security/advisories/GHSA-4rx6-g5vg-5f3j
- https://nvd.nist.gov/vuln/detail/CVE-2022-31173
- https://github.com/graphql-rust/juniper/commit/2b609ee057be950e3454b69fadc431d120e407bb
- https://github.com/graphql-rust/juniper/commit/8d28cdba6eb10f53490ba41d1b5cb40506c2de22
- https://github.com/graphql-rust/juniper/blob/juniper-v0.15.10/juniper/CHANGELOG.md#01510-2022-07-28
- https://rustsec.org/advisories/RUSTSEC-2022-0038.html
Пакеты
juniper
< 0.15.10
0.15.10
Связанные уязвимости
Juniper is a GraphQL server library for Rust. Affected versions of Juniper are vulnerable to uncontrolled recursion resulting in a program crash. This issue has been addressed in version 0.15.10. Users are advised to upgrade. Users unable to upgrade should limit the recursion depth manually.
Уязвимость серверной библиотеки Juniper среды выполнения запросов GraphQL, связанная с неконтролируемой рекурсией, позволяющая нарушителю вызвать отказ в обслуживании