Skip to content
Heist/ feed
Back to feed
LowFix available

Stack overflow when parsing deeply nested input in pest_grammars

Type: advisorySources: OSV

## 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](https://github.com/pest-parser/pest/blob/v2.9.3/grammars/Cargo.toml#L16-L18) and [deep-nesting regression tests](https://github.com/pest-parser/pest/blob/v2.9.3/grammars/src/lib.rs#L94-L215). 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 invo

Products
pest_grammars
Affected versions
Not specified
Fixed versions
2.9.3
CVEs
Not specified
Confirmed fixed CVEs
Not specified
Updated in this feed
30 Oct 2026, 23:06 UTC · Revision 1

Source evidence

Stack overflow when parsing deeply nested input in pest_grammars

core-osv · Original source

Published 16 Oct 2026, 12:00 UTC

## 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](https://github.com/pest-parser/pest/blob/v2.9.3/grammars/Cargo.toml#L16-L18) and [deep-nesting regression tests](https://github.com/pest-parser/pest/blob/v2.9.3/grammars/src/lib.rs#L94-L215). 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 invo

osv:RUSTSEC-2026-0366

pest_grammars

Fixed versions: 2.9.3

Complete source record
{
  "id": "edd86f69aef4d9866ddd8dd29afedb0ede1879e672e37a3fe8ec154112b7e4ea",
  "url": "https://osv.dev/vulnerability/RUSTSEC-2026-0366",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Stack overflow when parsing deeply nested input in pest_grammars",
    "summary": "## 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](https://github.com/pest-parser/pest/blob/v2.9.3/grammars/Cargo.toml#L16-L18) and [deep-nesting regression tests](https://github.com/pest-parser/pest/blob/v2.9.3/grammars/src/lib.rs#L94-L215). 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 invo",
    "evidence": "osv:RUSTSEC-2026-0366",
    "products": [
      {
        "name": {
          "value": "pest_grammars",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "2.9.3",
            "evidence": "/affected/0/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "low",
    "structured": {
      "id": "RUSTSEC-2026-0366",
      "aliases": [
        "GHSA-7632-4q2x-hvjw",
        "RUSTSEC-2026-0366"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "SEMVER",
              "events": [
                {
                  "introduced": "0.0.0-0"
                },
                {
                  "fixed": "2.9.3"
                }
              ]
            }
          ],
          "package": {
            "name": "pest_grammars",
            "purl": "pkg:cargo/pest_grammars",
            "ecosystem": "crates.io"
          },
          "database_specific": {
            "cvss": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L",
            "source": "https://github.com/rustsec/advisory-db/blob/osv/crates/RUSTSEC-2026-0366.json",
            "categories": [
              "denial-of-service"
            ],
            "informational": null
          },
          "ecosystem_specific": {
            "affects": {
              "os": [],
              "arch": [],
              "functions": [
                "pest_grammars::json::JsonParser::parse"
              ]
            },
            "affected_functions": null
          }
        }
      ],
      "modified": "2026-10-16T23:30:02.385972501Z",
      "provider": "osv",
      "references": [
        "https://crates.io/crates/pest_grammars",
        "https://rustsec.org/advisories/RUSTSEC-2026-0366.html",
        "https://github.com/pest-parser/pest/pull/1212"
      ],
      "provider_metadata": {
        "license": "CC0-1.0"
      }
    },
    "related_cves": [],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 349391,
  "published_at": "2026-10-16T12:00:00+00:00"
}