ANT-2026-SC8JK49A · ffmpeg/ffmpeg

heap-buffer-overflow high

Severity Claude critical · Security research firm high · Maintainer -

Discovered by Claude Mythos Preview

REPORT

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

ANT-2026-SC8JK49A: Heap-buffer-overflow in ffmpeg

FFmpeg's Dirac decoder allocates s->mctmp at diracdec.c:344 with size (stride+MAX_BLOCKSIZE)(h+MAX_BLOCKSIZE)sizeof(s->mctmp) (53760 bytes for this input). During interpolation, line 1950 executes memset(mctmp + 2p->yoffsetp->stride, 0, 2rowheight) where rowheight is derived from parsed bitstream parameters. An 83-byte crafted Dirac bitstream sets parameters such that 2*rowheight = 18432 and the target offset lands at the very end of the allocation, producing an 18432-byte out-of-bounds zero-write immediately past the buffer. An attacker who can deliver a Dirac file to any FFmpeg-based consumer gets heap corruption and at minimum a crash.

Target

Project: ffmpeg

Technical Details

ASAN: heap-buffer-overflow WRITE of size 18432 at 0x52f00000d600 (0 bytes past a 53760-byte region allocated at diracdec.c:344). The root cause is that the size passed to memset (2rowheight) and the offset (mctmp + yrowheight + 2p->yoffsetp->stride) are computed from bitstream-controlled plane/stride parameters without validating that they stay within the bounds of the s->mctmp allocation.

Crash trace:

INFO: Running with entropic power schedule (0xFF, 100).
INFO: Seed: 2160859169
INFO: Loaded 1 modules   (69047 inline 8-bit counters): 69047 [0x644b634f1c78, 0x644b63502a2f), 
INFO: Loaded 1 PC tables (69047 PCs): 69047 [0x644b63502a30,0x644b636105a0), 
/out/ffmpeg_AV_CODEC_ID_DIRAC_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.]

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-SC8JK49A.


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

SECURITY RESEARCH FIRM ANALYSIS

Triage and disclosure were performed by Calif.

Verdict
true positive
Severity
high
UPSTREAM FIX

The change that resolved this finding.

diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index 2eabf74274253..2a047c0bb9cda 100644
--- a/libavcodec/diracdec.c
+++ b/libavcodec/diracdec.c
@@ -341,7 +341,7 @@ static int alloc_buffers(DiracContext *s, int stride)
 
     s->edge_emu_buffer_base = av_malloc_array(stride, MAX_BLOCKSIZE);
 
-    s->mctmp     = av_malloc_array((stride+MAX_BLOCKSIZE), (h+MAX_BLOCKSIZE) * sizeof(*s->mctmp));
+    s->mctmp     = av_malloc_array((stride+MAX_BLOCKSIZE), (h + 5*MAX_BLOCKSIZE) * sizeof(*s->mctmp));
     s->mcscratch = av_malloc_array(stride, MAX_BLOCKSIZE);
 
     if (!s->edge_emu_buffer_base || !s->mctmp || !s->mcscratch)
@@ -1944,7 +1944,7 @@ static int dirac_decode_frame_internal(DiracContext *s)
                     h = p->height - start;
                 else
                     h = p->ybsep - (start - dsty);
-                if (h < 0)
+                if (h <= 0)
                     break;
 
                 memset(mctmp+2*p->yoffset*p->stride, 0, 2*rowheight);

https://github.com/FFmpeg/FFmpeg/commit/bbdce45fda1ef92f0a8f5a8a995dde3a79fa7acc

TIMELINE

Dates from discovery through public reveal.

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

SHA-3-512 hash:

d99ab4d3415875490a97d39d7c2c4105fe96b8f152b981b5b595d7bdc6ab5793fe97f65243f1b5b2a4e31fda340355395aa264892a638df4d99d8d29008e574d

Committed 2026-05-08 00:11 PT

Revealed 2026-08-17 13:01 PT

Verify (download preimage.json)

Show preimage JSON
{
  "ant_id": "ANT-2026-SC8JK49A",
  "bug_class": "Heap-buffer-overflow",
  "claude_severity": "critical",
  "commit_sha": null,
  "created_at": "2026-03-24T18:44:27+00:00",
  "description": "FFmpeg's Dirac decoder allocates s->mctmp at diracdec.c:344 with size (stride+MAX_BLOCKSIZE)*(h+MAX_BLOCKSIZE)*sizeof(*s->mctmp) (53760 bytes for this input). During interpolation, line 1950 executes memset(mctmp + 2*p->yoffset*p->stride, 0, 2*rowheight) where rowheight is derived from parsed bitstream parameters. An 83-byte crafted Dirac bitstream sets parameters such that 2*rowheight = 18432 and the target offset lands at the very end of the allocation, producing an 18432-byte out-of-bounds zero-write immediately past the buffer. An attacker who can deliver a Dirac file to any FFmpeg-based consumer gets heap corruption and at minimum a crash.",
  "discovered_at": null,
  "location": null,
  "poc_sha256": null,
  "preimage_version": 1,
  "project": "ffmpeg",
  "reproduction": null,
  "technical_details": "ASAN: heap-buffer-overflow WRITE of size 18432 at 0x52f00000d600 (0 bytes past a 53760-byte region allocated at diracdec.c:344). The root cause is that the size passed to memset (2*rowheight) and the offset (mctmp + y*rowheight + 2*p->yoffset*p->stride) are computed from bitstream-controlled plane/stride parameters without validating that they stay within the bounds of the s->mctmp allocation.",
  "title": "Heap-buffer-overflow in ffmpeg",
  "vendor_severity": "high"
}