ANT-2026-HRZEDXBB · ghostscript

stack-buffer-overflow critical

Severity Claude critical · Security research firm critical · Maintainer -

Discovered by Claude Mythos Preview

REPORT

Anthropic's analysis, sealed at approval. Disclosure to the maintainer was performed by Ada Logics.

ANT-2026-HRZEDXBB: Stack-buffer-overflow in ghostscript

In Ghostscript's Sampled Function evaluator (gsfunc0.c), fn_interpolate_linear allocates a stack array uint sdata[max_Sd_n] with max_Sd_n = 64 and passes it to fn_gets_8, which writes n uint values into it. The value of n is taken directly from the PDF Function dictionary's /Range array length and is only checked for n > 0 in fn_check_mnDR, never against max_Sd_n. A crafted PDF supplying a FunctionType 0 with a 200-element /Range (n = 100) causes fn_gets_8 to write 100 uints into the 64-slot stack buffer, corrupting adjacent stack memory. Because Ghostscript routinely processes untrusted PDFs in print servers, thumbnailers, and conversion pipelines, this attacker-controlled stack write is a realistic path toward remote code execution.

Target

Project: ghostscript
Location: pdf/pdf_func.c:pdfi_build_sub_function (crash in base/gsfunc0.c fn_gets_8)

Technical Details

ASAN: stack-buffer-overflow WRITE of size 4 in fn_gets_8, overflowing the 256-byte (64 × uint) sdata stack object declared in fn_interpolate_linear. Root cause: the output-dimension count n is derived from the user-supplied /Range array and fn_check_mnDR only enforces n > 0, so any n > 64 overruns the fixed stack buffer during sample unpacking.

Crash trace:

INFO: Running with entropic power schedule (0xFF, 100).
INFO: Seed: 2775612483
INFO: Loaded 3 modules   (241643 inline 8-bit counters): 14221 [0x7603ebac62a0, 0x7603ebac9a2d), 958 [0x7603ebb67778, 0x7603ebb67b36), 226464 [0x5b23e9f2df20, 0x5b23e9f653c0), 
INFO: Loaded 3 PC tables (241643 PCs): 14221 [0x7603ebac9a30,0x7603ebb01300), 958 [0x7603ebb67b38,0x7603ebb6b718), 226464 [0x5b23e9f653c0,0x5b23ea2d9dc0), 
/out/gstoraster_pdf_fuzzer: Running 1 inputs 1 time(s) each.
Running: /tmp/poc
EXIT_CODE:1

Reproduction

Reproduce against the target as described under Technical Details.

[No reproducer or sanitizer output attached — request from security-cvd@anthropic.com if needed.]

Suggested Fix

Validate params.n against max_Sd_n when building/checking the Sampled Function (e.g., in fn_check_mnDR or the FunctionType 0 constructor) and reject functions with n > max_Sd_n, or dynamically allocate sdata based on n.

Acknowledgement

This vulnerability was discovered by Claude, Anthropic's AI assistant, and triaged by the Anthropic security team in collaboration with Anthropic Research. Please direct questions to security-cvd@anthropic.com and reference ANT-2026-HRZEDXBB.


Reference: ANT-2026-HRZEDXBB
Anthropic CVD Policy: https://www.anthropic.com/coordinated-vulnerability-disclosure

SECURITY RESEARCH FIRM ANALYSIS

Triage and disclosure were performed by Ada Logics.

Verdict
true positive
Severity
critical
TIMELINE

Dates from discovery through public reveal.

  1. 2026-03-24 Reported to tracker
  2. 2026-05-07 Sent to maintainer
  3. 2026-05-12 Maintainer acknowledged
  4. 2026-05-18 Patch released
  5. 2026-08-17 Publicly revealed
PROVENANCE

SHA-3-512 hash:

516b721dac9fd428e9fa99e9bca6317651eb49ba8d50bf8b49d35542a468af494628446a2284a1745b91a48e1bf4eec7523c9a8a0b7c64698ed15e9c2bc1f59f

Committed 2026-05-07 14:16 PT

Revealed 2026-08-17 16:33 PT

Verify (download preimage.json)

Show preimage JSON
{
  "ant_id": "ANT-2026-HRZEDXBB",
  "bug_class": "Stack-buffer-overflow",
  "claude_severity": "critical",
  "commit_sha": null,
  "created_at": "2026-03-24T20:44:08+00:00",
  "description": null,
  "discovered_at": null,
  "location": null,
  "poc_sha256": null,
  "preimage_version": 1,
  "project": "ghostscript",
  "reproduction": null,
  "technical_details": null,
  "title": "Stack-buffer-overflow in ghostscript",
  "vendor_severity": "critical"
}