Skip to content

security: bound archive member enumeration before materialization - #87

Draft
seonghobae wants to merge 3 commits into
security/bound-sbom-archive-input-v2from
security/bound-archive-member-enumeration-v2
Draft

security: bound archive member enumeration before materialization#87
seonghobae wants to merge 3 commits into
security/bound-sbom-archive-input-v2from
security/bound-archive-member-enumeration-v2

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Replacement stack repair

This draft supersedes now-closed conflicted/stale-stack PR #70. It reconstructs the same parser-resource hardening on the exact current replacement predecessor #86 without rebasing, retargeting, force-updating, or rewriting either historical branch.

Immutable RED evidence

Exact-head CI run 31150692931 checked out 22d3d66ac3f5ff35b100a4095aa09afb07fa0da1 with persisted credentials disabled. Package acceptance and Ruff succeeded. Every Python 3.10–3.13 test lane failed at the focused regressions; Python 3.13 reported 15 failed, 775 passed.

The RED tree proved the exact predecessor still entered ZipFile/tar parser materialization before enforcing the 10,000-member ceiling and lacked bounded ZIP central-directory, expanded-tar, and extension-header preflight controls.

Reconstructed bounded implementation

The exact current tree reapplies the reviewed #70 resource-boundary delta onto #86's later descriptor/path-identity hardening rather than copying the stale branch wholesale.

  • scans one canonical single-disk non-ZIP64 ZIP central directory with bounded descriptor reads before ZipFile allocates ZipInfo objects, requiring EOCD/record count/size/offset agreement and enforcing at most 10,000 members;
  • streams gzip/tar physical headers before semantic parsing, enforcing at most 10,000 physical members, a 512 MiB aggregate expanded-tar ceiling, and a 1 MiB per-extension-header ceiling;
  • rejects malformed/truncated central directories, multi-disk/ZIP64 forms, malformed ZIP extras, invalid tar framing/checksums, links, devices, FIFOs, sparse archives, unsupported forms, nonzero trailing data, and decompression corruption through stable fail-closed errors;
  • uses sequential tar parsing rather than getmembers() materialization;
  • preserves security: bound direct SBOM archive input before parser execution #86's no-follow preflight, descriptor/path identity, finite compressed-byte ceiling, live read/seek/position bounds, growth/mutation rejection, metadata/dependency semantics, deterministic CycloneDX output, and stable direct-artifact errors;
  • keeps scripts/ci inside the canonical production coverage scope and retains only directly relevant operator/research documentation and [Unreleased] evidence;
  • changes no .github workflow, credential, permission, model, network transport, protected ref, publication, signing, attestation, or release authority.

Exact-current-head verification

CI run 31151452927 checked out exact SHA 0f6476ee4f705da7b0cd5fa7120b87dcea5803b6 explicitly and succeeded across Python 3.10, 3.11, 3.12, and 3.13 plus wheel/sdist package acceptance. Python 3.13 recorded:

  • 790 passed;
  • production coverage exactly 1,631/1,631 statements and 558/558 branches (100%, zero partial branches);
  • release_evidence.py at 371/371 statements and 122/122 branches;
  • Ruff, compileall, and hourly product-guard self-test success.

Because this PR remains draft behind #86#64#62, draft-skipped SAST/Security/review evidence is not acceptance. The organization Security Scan must also be rerun after ContextualWisdomLab/.github#799 integrates; its reviewer prerequisite is .github#813.

Remaining gates

Keep this PR draft while predecessor #86 is draft and transitively depends on #64/#62. Before integration require accepted predecessors, exact-current-head applicable SAST and repaired organization Security Scan, completed automated review, qualifying independent non-author approval, zero unresolved valid threads, branch protection, and every repository policy gate. Missing, pending, draft-skipped, stale-head, predecessor-head, synthetic-merge, rate-limited, or fail-open evidence is not acceptance.

Do not merge, auto-merge, release, publish, rebase, retarget, or force-update while draft.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 50577628-1086-415b-a87c-7ea5ffd26c2f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant