Various parsing bugs

Đang mở
#109 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
52/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Lĩnh vực
backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.
Ngôn ngữ chính
Haskell
Star
42
Fork
41
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của haskell/tar

Tất cả issue của haskell/tar

Issue tương tự

Thêm issue về Haskell

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.