Repository navigation
fix(iso9660): read a directory record whose identifier padding byte is not zero - #15020
Conversation
…s not zero A record whose even-length identifier was followed by a nonzero padding byte failed as malformed, and the walk ended the whole inventory on it. The byte takes no part in decoding: Linux isofs, libarchive, pycdlib and 7-Zip step over it, and 7-Zip notes that some discs store another value there. The value is no longer checked. A record too short to hold the padding byte stays malformed.
Joliet identifiers are UCS-2, so every file and directory record in that tree has the padding byte. The case now damages the record of the tree the reader walks and checks that tree was the one listed.
[Medium impact] The PR appears safe to merge; accepting the unused padding value leaves record bounds intact. SummaryThe PR lets ISO 9660 readers accept nonzero identifier padding without weakening record bounds.
Reviews (2) · Last reviewed commit: "docs(iso9660): describe the unchecked id..." · Reviewed by Greptile |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Independent verification of the same fix (not a duplicate PR): I arrived at the equivalent patch locally against
That adds local runtime evidence to the CI results recorded in the PR body. The fixtures are still synthetic; I did not test a real xorriso-produced image. One optional addition from my local patch: a parser-level regression in |
|
thanks! merged after a clean review and green CI. nonzero identifier padding is accepted; missing padding is still rejected. |
* commit '4ccc685dd5ed028bc625fdd8760539ce5a492d8d': (228 commits) test(asar): verify cleanup on the original file handle (morluto#15155) fix(ubi): bound smaller-grid probe memoization (morluto#15168) fix(artifacts): distinguish content from containment changes (morluto#15165) fix(bflt): retain complete text when data is truncated (morluto#15160) refactor(domain): reuse graph projection and validation helpers (morluto#15173) fix(iso9660): read a directory record's data length from its little-endian half (morluto#14801) test(ghidra): wait for each fixture spawn before expiring startup (morluto#15172) test(beam): reuse the CLI Evidence reader (morluto#15171) test(oci): share descriptor budget refusal assertions (morluto#15159) refactor(audit): share byte framing for offline audit logs (morluto#15162) refactor(evidence): reuse observed file reports for binary metadata (morluto#15161) fix(doctor): omit package-runner cache shims from installations (morluto#15059) refactor(packages): share package inspection budget contracts (morluto#15158) refactor(desktop): share completed command answer recovery (morluto#15156) refactor(views): share page byte reservations (morluto#15152) refactor(artifacts): share GPU and media asset layout rules (morluto#15150) fix(setup): name the detected host when Hopper setup does not apply (morluto#14449) fix(iso9660): read a directory record whose identifier padding byte is not zero (morluto#15020) fix(windows): report the ACE count a private DACL check observed (morluto#14450) fix(artifacts): read Ogg Opus channel mapping tables (morluto#14975) ...
* commit 'e18ed55bac14191010efe91ba61489cab1d2ba55': (137 commits) fix(artifacts): report macOS package bundle release versions (morluto#14860) test(asar): verify cleanup on the original file handle (morluto#15155) fix(ubi): bound smaller-grid probe memoization (morluto#15168) fix(artifacts): distinguish content from containment changes (morluto#15165) fix(bflt): retain complete text when data is truncated (morluto#15160) refactor(domain): reuse graph projection and validation helpers (morluto#15173) fix(iso9660): read a directory record's data length from its little-endian half (morluto#14801) test(ghidra): wait for each fixture spawn before expiring startup (morluto#15172) test(beam): reuse the CLI Evidence reader (morluto#15171) test(oci): share descriptor budget refusal assertions (morluto#15159) refactor(audit): share byte framing for offline audit logs (morluto#15162) refactor(evidence): reuse observed file reports for binary metadata (morluto#15161) fix(doctor): omit package-runner cache shims from installations (morluto#15059) refactor(packages): share package inspection budget contracts (morluto#15158) refactor(desktop): share completed command answer recovery (morluto#15156) refactor(views): share page byte reservations (morluto#15152) refactor(artifacts): share GPU and media asset layout rules (morluto#15150) fix(setup): name the detected host when Hopper setup does not apply (morluto#14449) fix(iso9660): read a directory record whose identifier padding byte is not zero (morluto#15020) fix(windows): report the ACE count a private DACL check observed (morluto#14450) ...
* commit '76cb6645be39cf3844f7a8bb4568b02d8a713595': (95 commits) fix(macos-pkg): retain cpio hard-link contents (morluto#15157) fix(artifacts): report macOS package bundle release versions (morluto#14860) test(asar): verify cleanup on the original file handle (morluto#15155) fix(ubi): bound smaller-grid probe memoization (morluto#15168) fix(artifacts): distinguish content from containment changes (morluto#15165) fix(bflt): retain complete text when data is truncated (morluto#15160) refactor(domain): reuse graph projection and validation helpers (morluto#15173) fix(iso9660): read a directory record's data length from its little-endian half (morluto#14801) test(ghidra): wait for each fixture spawn before expiring startup (morluto#15172) test(beam): reuse the CLI Evidence reader (morluto#15171) test(oci): share descriptor budget refusal assertions (morluto#15159) refactor(audit): share byte framing for offline audit logs (morluto#15162) refactor(evidence): reuse observed file reports for binary metadata (morluto#15161) fix(doctor): omit package-runner cache shims from installations (morluto#15059) refactor(packages): share package inspection budget contracts (morluto#15158) refactor(desktop): share completed command answer recovery (morluto#15156) refactor(views): share page byte reservations (morluto#15152) refactor(artifacts): share GPU and media asset layout rules (morluto#15150) fix(setup): name the detected host when Hopper setup does not apply (morluto#14449) fix(iso9660): read a directory record whose identifier padding byte is not zero (morluto#15020) ...
Summary
Closes #15019
One directory record whose even-length identifier was followed by a padding byte other than 0x00 made
inspect_artifactandextract_artifactrefuse the whole ISO 9660 image as malformed, wherever the record sat in the walked tree. The byte takes no part in decoding: Linux isofs, libarchive, pycdlib and 7-Zip step over it without reading it, and 7-Zip notes that some discs store another value there. This PR stops checking the value. A record too short to hold the padding byte stays malformed.Problem and expected behavior
Smallest trigger: a valid image in which the byte after one even-length identifier (for example the 8-byte
AB.TXT;1) is 0x20 instead of 0x00.On
main,iso9660DirectoryRecordAtrefused that record with "directory record padding byte after an even-length identifier is not zero" (src/domain/iso9660/iso9660Structures.ts:240-245at21cfc809b), and the walk unwraps that failure (src/artifacts/Iso9660ArtifactReader.ts:233), so the inventory ended asmalformedwithout entries. In a Joliet tree every file and directory identifier is UCS-2 and therefore even-length, so every record there other than.and..has this byte.None of the common readers reads it:
// SkipZeros(padSize);followed bySkip(padSize); // it's bug in some cd's. Must be zeros(IsoIn.cpp:259-261).if (rs->len & 1) (rs->len)++;(fs/isofs/rock.c:57-60).rr_start = p + name_len + (name_len & 1 ? 0 : 1);(parse_file_info,:1898-1900).if self.len_fi % 2 == 0: record_offset += 1(pycdlib/dr.py:296-297).Expected: the record is read like any other, its file or directory is listed, and the rest of the tree is listed. A record that cannot hold the padding byte stays
malformed.Change and scope
src/domain/iso9660/iso9660Structures.ts:iso9660DirectoryRecordAtno longer compares the padding byte with zero. The check that the identifier and its padding byte fit the record is the one before it and is unchanged.docs/guides/firmware/iso9660-images.md: the sentence that listed the zero padding byte among the malformed cases now names the fit rule and says the value is not checked.Not included:
..(fix(iso9660): read Joliet trees whose .. records name their own directory #14817) changes also accept their cases without a limitation.directory_padding) is unchanged. It keeps a record from being skipped behind that byte, and I have no reference for images that break it.Contribution scope: ordinary fix within existing boundaries (static format inspection); maintainer scope decision not applicable.
Contract and boundary impact
iso9660DirectoryRecordAtowns record parsing forrootRecordand forparseIso9660DirectoryExtent. No consumer reads the padding byte or the system use area that follows it (rgforidentifierEnd,paddedand system use oversrc/domain/iso9660andsrc/artifacts/Iso9660ArtifactReader.ts). A descriptor's root record has a 1-byte identifier and therefore no padding byte, so descriptor parsing is unaffected.padding_fieldfailure is no longer produced.docs/public/product-catalog.json), package, or installation impact: none.Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
Evidence and regression coverage
src/artifacts/Iso9660ArtifactReader.boundaries.test.ts: "rejects a nonzero padding byte after an even-length identifier" becomes "lists a record in the %s tree whose padding byte after an even-length identifier is not zero", for the primary tree and for the Joliet tree. ThroughscanCanonicalArtifactInventory, the record with the nonzero byte and the record after it are both listed with their sizes and verified hashes, and the root row'sname_sourceconfirms that the tree holding the byte is the one walked. On the base reader both cases reject asmalformedatpadding_field, which is what the replaced case asserted for the primary tree.src/domain/iso9660/iso9660Structures.test.ts, "requires the padding byte an even-length identifier needs to fit its record", is unchanged and is the control: a record too short for the byte is still refused atidentifier_length.Boundary regressions: format assumptions. The accepted nonzero value is paired with the unchanged refusal of a record that cannot hold the byte, and the case runs in both trees because Joliet identifiers always carry the byte.
For evidence-bearing changes:
Validation performed
iso9660DirectoryRecordAt, its two callers, the ISO 9660 fixture (buildIso9660Imagewritesab;1as 4 bytes in the primary tree and 8 bytes in the Joliet tree, each followed by a padding byte) and every ISO 9660 test that names a padding check (rgoversrcandtests): only the replaced case depended on the value.d5812dd48(run 46166326472): Static checks, Documentation, Build package, Portable tests, Native package baseline (linux x64), Build bundled Windows x64 native controls, Test shard (1/1) and CI required passed; none failed. The shard selected 3 affected files and ran 132 tests, all of which passed:src/artifacts/Iso9660ArtifactReader.boundaries.test.ts(72),src/domain/iso9660/iso9660Structures.test.ts(23) andsrc/domain/artifactFormatRecognition.test.ts(37).Compatibility, safety, and release
rea-agents-6.10.1does not containe896f6054).Author readiness
Human owner: @viniciusdsandrade
Author checklist (completed by the PR author before requesting review)
type(scope): outcome.REA_runtime setting with a default, floor, and maximum, unless a fixed ceiling has a stated reason. See Adding a runtime setting.