Various parsing bugs

Aperta
#109 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Ambito
backend

Direzione di ricerca

Start by reading the tar parser code that handles pax headers and numeric fields; the issue does not name specific files or tests. Use the linked N27, N28, F14, N20, F37, F29, and F30 cases to reproduce the reported behavior. Done means the parser handles each case according to the described POSIX behavior and rejects or correctly interprets invalid numeric values.

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

Descrizione

I'm working on a test suite tar-minefield for tar file parsing (docs: stoppels.ch/tar), with the ultimate goal to ensure implementations converge on similar behavior, reducing parser differential vulnerabilities.

During this work, I found a few bugs in Haskell's tar.

Related to pax headers:

  1. A pax header with both path and linkpath drops path. Test cases: N27 (symlink) and N28 (hard link). In this test case, GNU tar, libarchive, Python, Go and others extract a file with a 120-character name, while Haskell's tar produces one with 100 chars.
  2. The pax size is ignored. POSIX: "This record shall override the size field in the following header block(s)". See F14.
  3. For a repeated keyword, the first record wins, but according to POSIX: "When extended header records conflict, the last one given in the header shall take precedence". See N20.

Related to parsing of numeric fields:

  1. 8 and 9 are accepted as octal digits, so a size of 00000000090 is read as 72, where GNU tar, libarchive, Python and most others refuse it. See F37.
  2. A negative base-256 number is read as positive, so size of -512 becomes 512. See F29.
  3. A base-256 number that doesn't fit in 64 bits wraps around. See F30.
Lingua principale
Haskell
Stelle
42
Fork
41
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

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

  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 haskell/tar

Tutte le issue di haskell/tar

Issue simili

Altre issue su Haskell

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.