Badly formed files can cause `create_sample_table()` to OOM.
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
Direzione di ricerca
Inizia tracciando create_sample_table() e la gestione dei box stsc e stsz, quindi esamina come get_indices espone i dati analizzati. Confronta gli scenari di errore di Gecko Bugs 1661368 e 1814791, inclusi i conteggi di sample non corrispondenti o eccessivi. Il lavoro è completato quando si impedisce ai file malformati di causare un’allocazione arbitraria o OOM, preservando al contempo l’analisi dei file validi.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
See Gecko Bug 1661368 and more recently Bug 1814791.
There is currently no validation of whether a file with an stsc box with a large sample count is actually referencing offsets that fall within the file, which allows create_sample_table() to allocate an arbitrarily large vector and OOM.
We could just set a configurable hard limit on the number of samples it can allocate, but I don't know if that's the best solution.
We can also fail early when the relevant sample boxes have mismatched sample counts, but I'm not sure if there are files that currently parse and break that rule, and as tnikkel pointed out, the fuzzer may still find a way to create a matching sample count that causes OOM. Might still be worth implementing this if it makes sense to fail that way.
I think the most ideal solution is instead to make create_sample_table() aware of the amount of data in the file that is currently available to the caller, and use the stsz box to determine how many samples the vector needs to allocate to reach EOF. For cases where the full size is not known beforehand, API users would have to call get_indices multiple times and be aware that their pointers will be invalid, but that doesn't seem like a difficult problem.
What I wonder is whether the available data is something that should be accessible from other parts of mp4parse as well, for example to allow the box parsing to indicate that it hit the end of the available data but can continue parsing when more data is available.
Feel free to let me know if this idea doesn't make sense, we can use this issue to brainstorm more solutions if necessary.
- Lingua principale
- Rust
- Stelle
- 448
- Fork
- 73
- Merge medio
- 6g 4h
- PR unite (30g)
- 1
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di mozilla/mp4parse-rust
-
AVIF metadata is improperly marked as privateForse già presa @amyspark l’ha presa 185 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
mozilla/mp4parse-rust#444 · 5 commenti ·
-
Allow reading Exif metadata from AVIF imagesForse già presa @amyspark l’ha presa 185 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
mozilla/mp4parse-rust#441 ·
-
senc boxAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
mozilla/mp4parse-rust#415 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 28/100
mozilla/mp4parse-rust#414 · 4 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
mozilla/mp4parse-rust#412 · 2 commenti ·
Tutte le issue di mozilla/mp4parse-rust
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
swc-project/swc#12516 ·
I maintainer di solito rispondono entro 1 giorno
-
mls-rs-crypto-awslc: exact aws-lc-rs =1.16.3 pin blocks rustls security updateForse già presa @muscariello l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
[work-item] adam-adae-worsening-emergence: conform spec.yaml to the specification style contract (REQ-1280)Forse già presa @muse-yamaa-bot l’ha presa oggi. Apertawork-item
Difficoltà 1/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Possible memory leak: message iterators from pactffi_pact_handle_get_*message_iter are never deletedAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
pact-foundation/pact-go#652 ·
I maintainer di solito rispondono entro 1 giorno