Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta Adatta ai principianti
#2,425 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@Nikhil-jaiswal007 ci sta già lavorando.

Dal 25/10/2026.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
c
Ambito
backend, security

Direzione di ricerca

Inizia in src/lib_ccx/ccx_gxf.c, in corrispondenza di parse_ad_cdp (intorno alla riga 558), e segui come len, cdp_length e cc_count descrivono i byte rimanenti del pacchetto. Verifica che i dati dei sottotitoli dichiarati siano contenuti prima della copia, poi compila con ASan e passa il PoC di 16 byte fornito attraverso il parser GXF. Il lavoro è completato quando l’input viene rifiutato in sicurezza senza una lettura fuori dai limiti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
C
Stelle
908
Fork
595
Merge medio
3g 6h
PR unite (30g)
31

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di CCExtractor/ccextractor

Tutte le issue di CCExtractor/ccextractor

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.