Skip to main content

RaTeX ratex-parser CVE-2026-53531

| EUVDEUVD-2026-64180 MEDIUM
Uncontrolled Resource Consumption (CWE-400)
2026-07-07 https://github.com/erweixin/RaTeX GHSA-4w5h-hx6r-28q7
6.9
CVSS 4.0 · Vendor: https://github.com/erweixin/RaTeX
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Send crafted LaTeX to math-rendering endpoint
  2. Delivery
    Parser recurses one stack frame per nesting level
  3. Exploit
    Native OS stack exhausted (~200k levels / 8MB)
  4. Execution
    SIGABRT terminates entire process
  5. Impact
    Service unavailable until restarted

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V2 - Validation and Business Logic Resource consumption limits
MITRE ATT&CK

1 technique across 1 tactic: Impact

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

No special conditions are required for exploitation against default deployments that expose LaTeX input to untrusted users - any service forwarding user-supplied LaTeX to ratex-parser is vulnerable without additional configuration. All four nesting token types are equally effective triggers: {, \left(, \sqrt{, and ^{. On async runtime threads (e.g., Tokio) with 512 KB stacks, the threshold drops to approximately several hundred nesting levels (a few hundred bytes of input). On the default 8 MB main-thread stack, approximately 200,000 nesting levels (~400 KB of braces) are sufficient. Exploitation is limited only by access to a network endpoint that forwards input to ratex-parser; if the parser is invoked solely on pre-validated or trusted content, real-world risk is substantially reduced. No authentication, elevated privileges, or non-default configuration is required for the DoS primitive itself.

Impact

No CVSS vector or EPSS score is present in the available data; all metric assessments below are independently derived from the description and PoC. The attack requires no authentication and no special configuration - any endpoint forwarding user-supplied LaTeX to ratex-parser is vulnerable by default. The PoC is a trivial Python one-liner, confirming AC:L and establishing that exploit reliability is very high. The availability impact is maximal: the entire process crashes and cannot self-recover (A:H). There is no confidentiality or integrity impact (C:N, I:N). KEV status is not listed, meaning active exploitation has not been confirmed by CISA at time of analysis; however, the combination of a public PoC, zero authentication requirement, and reliable process-kill impact makes this a credible priority for any operator running ratex-parser in a network-accessible service. On smaller async worker stacks (512 KB), the threshold drops to a few hundred bytes of nesting, reducing even the minimal size bar for exploitation. No EPSS data was available to compare predicted exploitation probability against CVSS severity.

Exploit ScenarioDerived

An unauthenticated attacker sends a single HTTP request containing a LaTeX string composed of 200,000 opening brace characters followed by a token and 200,000 closing braces to a server-side math rendering endpoint backed by ratex-parser. The parser's recursive descent allocates one native stack frame per nesting level; at ~200,000 levels the 8 MB main-thread stack is exhausted, SIGABRT is delivered, and the entire rendering service process terminates. A publicly available PoC Python one-liner confirms reliable reproduction; on services using small async worker thread stacks (512 KB), only a few hundred bytes of nesting are required.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 08, 2026

Unbounded recursive descent in the RaTeX Rust crate ratex-parser crashes the entire host process when fed deeply nested LaTeX input. The mutual recursion across parse_expression, parse_atom, and parse_group in crates/ratex-parser/src/parser.rs carries no depth guard, so roughly 200,000 nested braces (~400 KB of input, or far less on async worker threads with 512 KB stacks) exhausts the native OS stack and triggers a fatal SIGABRT from which the process cannot recover. In any server-side math rendering deployment that accepts untrusted LaTeX, this constitutes a reliable unauthenticated denial-of-service; publicly available exploit code confirms trivial reproduction with a Python one-liner.

RemediationAI

No patched version of ratex-parser is confirmed in the advisory data at time of analysis. The definitive fix is to introduce a recursion depth counter passed through parse_group, parse_expression, and parse_atom, returning a structured parse error rather than recursing when depth exceeds a safe threshold (1,000-2,000 levels is a practical ceiling for legitimate LaTeX). The existing max_expand = 1000 macro expander limit is not a substitute and must not be relied upon as a control. Monitor https://github.com/erweixin/RaTeX/security/advisories/GHSA-4w5h-hx6r-28q7 for a patched release. As an immediate compensating control, operators should isolate the ratex-parser invocation in a separate subprocess with a configurable timeout and hard memory/stack limits (e.g., via ulimit -s on Linux), accepting added latency and inter-process communication overhead. Application-layer input length capping (e.g., reject LaTeX strings exceeding a few kilobytes) raises the bar but does not eliminate the risk, since the PoC uses only ~400 KB and smaller stacks require even less. Rate limiting at the API layer reduces the blast radius of repeated DoS attempts but does not prevent a single request from killing the process.

Affected VersionsENISA

RaTeX < 0.1.11

Affected Packages

cargo ratex-parser fix: 0.1.11
euvd ratex fix: 0.1.11

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in cargo, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

RaTeX is a Rust-based LaTeX rendering library whose parser (CPE: pkg:rust/ratex-parser) implements mutual recursion: parse_expression (parser.rs:113) calls parse_atom (parser.rs:281/285), which calls parse_group (parser.rs:451), which recurses back into parse_expression on every opening brace at line 459. An additional recursive edge exists via handle_left → parse_expression in crates/ratex-parser/src/functions/left_right.rs:47, triggered by \left tokens. Rust programs execute on native OS stacks - typically 8 MB for the main thread, as small as 512 KB for async runtime threads (e.g., Tokio). Because none of these functions carry a depth parameter or counter, every nesting level consumes one additional stack frame. The existing macro expander limit max_expand = 1000 (macro_expander.rs:64) does not intercept brace or \left tokens and provides no protection. With panic = "abort" set in Cargo.toml:48, and because Rust stack overflows unconditionally deliver SIGABRT regardless of panic strategy, the crash is unrecoverable at the process level. CWE-400 (Uncontrolled Resource Consumption) correctly classifies the root cause as an absent resource bound on recursive stack depth.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/erweixin/RaTeX) PRIMARY 6.9 MEDIUM
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
vuln.today AI 7.5 HIGH

Network-reachable via untrusted LaTeX input with no authentication or preconditions; sole impact is reliable full-process crash (A:H); no confidentiality or integrity effect.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (https://github.com/erweixin/RaTeX).

CVSS VectorVendor: https://github.com/erweixin/RaTeX

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
Low
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

1
CVSS changed
Aug 21, 2026 - 22:22 NVD
6.9 (MEDIUM)

DescriptionCVE.org

Summary

RaTeX’s recursive-descent parser recurses one (or more) native stack frame per nesting level at {, \left, \sqrt{, ^{, etc, with no maximum depth limit. A short, ~10 KB input of nested groups overflows the 8 MB main-thread stack and aborts the process. With panic = "abort" (Cargo.toml:48), and because a Rust stack overflow is always a fatal SIGABRT regardless of panic strategy this is an unrecoverable, whole-process denial of service reachable from a single untrusted LaTeX string.

Details

The mutual recursion has no depth guard (crates/ratex-parser/src/parser.rs):

parse_expression (:113)  ->  parse_atom (:281/285)  ->  parse_group (:451)
                                  ^                          |
                                  |   on '{' (:459) recurse  |
                                  +--------------------------+

\left adds another recursive edge: handle_left → parse_expression (crates/ratex-parser/src/functions/left_right.rs:47). The only counters present are unrelated to depth: leftright_depth (a \right-matching counter, parser.rs:24) and the macro expander’s max_expand = 1000 (macro_expander.rs:64), which does not gate brace / \left recursion (those tokens never pass through expand_once). There is no recursion_limit/depth parameter on parse_group, parse_expression, or parse_atom.

PoC

<img width="1097" height="158" alt="image" src="https://github.com/user-attachments/assets/29b837a2-c455-4cb6-a055-514b31c999c6" />

$ python3 -c 'import sys;sys.stdout.write("{"*200000+"x"+"}"*200000)' | ./target/release/parse
thread 'main' has overflowed its stack
fatal runtime error: stack overflow, aborting
Aborted (core dumped)
# exit 134

(Other nesting forms work equally, e.g. \left(×N, \sqrt{×N, ^{×N.)

Impact

A single small request crashes the whole RaTeX process. In a typical server-side math-rendering service this is a reliable, unauthenticated DoS; on smaller worker-thread stacks (e.g. a 512 KB async runtime thread) only a few hundred bytes of nesting are required.

Threat Intelligence Overview

EPSS Score
0.3%
Top 82% exploitable
Prevalence
Rare
niche Rust LaTeX parser, limited known production deployment
Threat Intel
1
1 source
Exploit
POC
Public exploit code exists
Social Media
1
Sightings
Data Quality
6 sources
Confidence: High

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC Yes
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
Poc
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact· derived
Medium

Priority Score

54
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +34
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy