Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Heap OOB read in parse_ad_cdp: cc_count not bounded by packet length

オープン 初心者向け
#2,425 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@Nikhil-jaiswal007 がすでに取り組んでいます。

2026年10月25日 から。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
c
領域
backend, security

調査の方向性

src/lib_ccx/ccx_gxf.c の parse_ad_cdp(558 行目付近)から始め、len、cdp_length、cc_count が残りのパケットバイト数をどのように表すかを追ってください。コピーする前に、申告された字幕データが収まることを確認し、次に ASan でビルドして、提供された 16 バイトの PoC を GXF パーサーに入力してください。入力が範囲外読み取りを起こすことなく安全に拒否されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

CCExtractor version: master HEAD

Bug

parse_ad_cdp in src/lib_ccx/ccx_gxf.c (line 558) reads cc_count from the CDP payload byte (5-bit field, max 31) and copies cc_count * 3 bytes starting at offset 9 without checking that those bytes fit within len.

cc_count = *cdp++ & 0x1f;          // line 558, attacker-controlled, up to 31

for (int i = 0; i < cc_count * 3; i++)   // line 560
{
    data->buffer[data->len + i] = cdp[i]; // reads past cdp allocation
}

The header validation at line 494 only checks len < 11. A 16-byte packet passes that check but with cc_count = 23 the loop reads 69 bytes starting at offset 9, going 60 bytes past the end of the buffer.

The cdp_length check at line 512 (cdp_length != len) validates that the declared length matches the buffer, but cc_count is never validated against cdp_length.

Impact

Heap out-of-bounds read. The OOB bytes are copied into data->buffer, so heap contents can leak into subtitle output.

Reached via: ccextractor untrusted.gxf -- a GXF ancillary-data packet with DID 0x61 / SDID 0x01 routes through parse_ad_pyld to parse_ad_cdp (line 656).

PoC

16-byte input (base64):

lmkQQEAAAXJ3OHt9dAABAA==

Hex: 96 69 10 40 40 00 01 72 77 38 7b 7d 74 00 01 00

Build with ASan, feed through the GXF parser. ASan reports heap-buffer-overflow READ at cdp[i].

Found with AI-assisted fuzzing.

Suggested fix

Check that the caption data section fits in the remaining packet before reading:

cc_count = *cdp++ & 0x1f;
if (cc_count * 3 > (len - (cdp - (cdp_start))))
{
    log("cc_count %d exceeds remaining CDP length\n", cc_count);
    return CCX_EINVAL;
}

Where cdp_start is the original cdp pointer saved at entry.

主要言語
C
スター
908
フォーク
595
平均マージ
3日 6時間
マージ済み PR(30日)
31

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

CCExtractor/ccextractor のほかの issue

CCExtractor/ccextractor の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。