Skip to content

← Actionable
Unrated

Stack overflow on deeply nested LaTeX input

What to do

Vendor fix available. Upgrade each affected package to the fixed version on its release line (latex-rust 1.0.5), redeploy, then verify what is actually installed.

This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.

Affected packages

  • crates.io latex-rust

    Affected
    >= 0.0.0-0, < 1.0.5
    Fixed in
    1.0.5

Sources

Severity and exploitation
Exploitation
No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
CVSS
not scored
EPSS
No dated EPSS signal available.
Source description

As published by the source; long descriptions are shortened.

The parser and layout engine in affected versions of `latex-rust` recurse once per level of nesting with no limit. Deeply nested input, such as `\frac{1}{…}`, braces, `\sqrt{…}`, `\left(`, or superscripts nested hundreds or thousands of levels deep, exhausts the call stack. A stack overflow in Rust aborts the process. It is not a panic, so it cannot be caught with `catch_unwind`. A program that renders LaTeX from untrusted input can therefore be terminated by a short string. With a release build on an 8 MiB stack, 700 nested `\frac{1}{…}` (about 7 KB of input) abort version 1.0.4, and 10,000 nested braces (about 20 KB) abort it as well. The threshold is lower on smaller stacks and in debug builds; on a 2 MiB thread in a debug build, about 35 nested fractions are enough. ```rust let mut src = String::from("1"); for _ in 0..700 { src = format!("\\frac{{1}}{{{src}}}"); } let _ = latex_rust::parse(&src); // stack overflow, process aborts ``` The fixed versions count nesting depth in the…

Dates and revisions
Published by the source
Last modified by the source
Source last checked
  1. Revision 1 · created ·

    Published from osv record RUSTSEC-2026-0311

Agent brief

Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.

# Patch Next advisory brief: rustsec-2026-0311

Advisory: Stack overflow on deeply nested LaTeX input
IDs: rustsec-2026-0311
Record: https://patchnext.com/advisories/rustsec-2026-0311 (revision 1, source checked 23 Oct 2026, 22:04 UTC)
Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected.
Severity: Unrated
Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV.
Vendor response: Vendor fix available; fixed versions by package: latex-rust 1.0.5. A vendor fix does not mean a deployment is fixed.

## Affected components
- crates.io latex-rust: affected >= 0.0.0-0, < 1.0.5; fixed in 1.0.5

## Suggested inspection (read-only)
- crates.io latex-rust: check the installed version with your package manager.

## Supported action
Upgrade each affected component to a fixed version on its release line. For a transitive dependency, upgrade the parent package or add an override or constraint, then regenerate the lockfile. Redeploy every environment that ran an affected version.

## Required regression checks
- Run the test suite and a production build.
- Exercise the features that depend on latex-rust.
- Repeat the inspection and confirm that only fixed versions remain installed.

## Rollback considerations
- Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward.

## Unresolved questions
- Which deployments run an affected version?
- Exploitation status can change. Check again before lowering the priority.
- Mark the work resolved only after the fixed version is verified in production.

## Sources
- Verified: https://osv.dev/vulnerability/RUSTSEC-2026-0311 (OSV record RUSTSEC-2026-0311 lists affected ranges: crates.io latex-rust >=0.0.0-0 <1.0.5 (fixed))

Commands are suggestions: review each one before running it.

Loading voting…