RUSTSEC-2026-0366 Stack overflow when parsing deeply nested input in pest_grammars

Not scored Published

Attackers can cause denial of service by sending deeply nested JSON to applications using the pest_grammars library, crashing the process via stack overflow.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is RUSTSEC-2026-0366?

RUSTSEC-2026-0366 is a denial of service vulnerability in pest_grammars, published on 16 Oct 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Impact

In affected versions, parsing deeply nested input with pest_grammars::json::JsonParser can exhaust the native stack and abort the hosting process. Applications that accept attacker-controlled JSON without suitable resource limits may therefore be vulnerable to denial of service.

The reported reproduction demonstrates this behavior with deeply nested JSON arrays. The nesting required to trigger an overflow depends on the platform, available stack space, and build configuration; there is no portable safe nesting threshold.

Patches

Upgrade to pest_grammars 2.9.3 or later.

Version 2.9.3 requires the updated pest runtime and includes regression tests for deeply nested JSON with the optional call budget disabled. Supported std builds automatically check available native stack headroom at parser checkpoints and return a handled stack limit reached error when insufficient space is detected. This protection operates independently of pest::set_call_limit(). See the 2.9.3 dependencies and deep-nesting regression tests.

These checks are best-effort. They do not provide universal stack-overflow protection, apply when stack bounds cannot be determined, or provide native-stack protection in no_std builds.

Workarounds and defense in depth

Applications unable to upgrade should reject excessive nesting before invoking the affected parser or configure a suitably conservative pest::set_call_limit() budget. A call budget is not a portable stack-depth guarantee.

Even after upgrading, applications parsing untrusted input should enforce workload-appropriate input, work, memory, and concurrency limits. Stack checks and call budgets do not enforce elapsed-time deadlines. Where a hard deadline or cancellation is required, use supervised parsing as described in the security policy: Parsing Untrusted Input.

Which versions are affected by RUSTSEC-2026-0366?

1 open source package ship an affected version, including pest_grammars.

PackageAffectedFixed in
pest_grammars crates.ioFrom 0.0.0-02.9.3

How do I fix RUSTSEC-2026-0366?

Upgrade pest_grammars to 2.9.3 or later.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is RUSTSEC-2026-0366 being exploited?

There is no known exploitation of RUSTSEC-2026-0366 in the wild and no public exploit code.

Sources

Also known as GHSA-7632-4q2x-hvjw.

Is RUSTSEC-2026-0366 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free