security: bound direct SBOM archive input before parser execution - #68
security: bound direct SBOM archive input before parser execution#68seonghobae wants to merge 19 commits into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
|
@opencode-agent Implement the bounded GREEN repair on exact current test-only head The immutable RED history is valid. Exact head Modify only these paths:
Required minimal implementation:
Stop without changing anything if the exact head is no longer |
|
@coderabbitai review Review only exact current head |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
base='421c0975cdabbc24cb4c42a9bb11e202cd33b0a4'
head='989959e429f165898818cf8ed4a1027a05024e40'
echo '== commit identities =='
git rev-parse HEAD
git cat-file -t "$base"
git cat-file -t "$head"
git merge-base --is-ancestor "$base" "$head" && echo 'base_is_ancestor=yes' || echo 'base_is_ancestor=no'
echo '== changed paths: exact range =='
git diff --name-status "$base" "$head"
echo '== implementation outline =='
ast-grep outline scripts/ci/generate_release_sbom.py --items all --view expanded
echo '== focused diff =='
git diff --unified=80 "$base" "$head" -- \
scripts/ci/generate_release_sbom.py \
tests/test_release_sbom_archive_bound.py \
docs/sbom-release-evidence.md \
CHANGELOG.md
echo '== parser/hash/metadata call contexts =='
rg -n -C 5 -P '\b(build_sbom|ZipFile|tarfile\.open|sha256|read_metadata|is_file|lstat)\b' \
scripts/ci/generate_release_sbom.py
echo '== test outline =='
ast-grep outline tests/test_release_sbom_archive_bound.py --items all --view expandedLength of output: 50761
Pass the original The changed-path boundary is correct. The 256 MiB constant, stable errors, documentation, APA 7 references, and CHANGELOG entry otherwise match the requested scope. I did not approve the pull request.
|
|
@coderabbitai review Review only exact current head |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
base='421c0975cdabbc24cb4c42a9bb11e202cd33b0a4'
head='d037f24c7b4603412f448e26ed2e1576ec79d36e'
echo '== commit identity =='
printf 'checkout: '; git rev-parse HEAD
printf 'base type: '; git cat-file -t "$base"
printf 'head type: '; git cat-file -t "$head"
git merge-base --is-ancestor "$base" "$head" && echo 'base ancestor: yes' || echo 'base ancestor: no'
echo '== exact changed paths =='
git diff --name-status "$base" "$head"
echo '== production outline =='
ast-grep outline scripts/ci/generate_release_sbom.py --items all --view expanded
echo '== focused test outline =='
ast-grep outline tests/test_release_sbom_archive_bound.py --items all --view expanded
echo '== exact scoped diff =='
git diff --unified=100 "$base" "$head" -- \
scripts/ci/generate_release_sbom.py \
tests/test_release_sbom_archive_bound.py \
docs/sbom-release-evidence.md \
CHANGELOG.md
echo '== descriptor, parser, metadata, and digest contexts =='
rg -n -C 8 -P '\b(build_sbom|main|lstat|fstat|open|os\.open|O_NOFOLLOW|ZipFile|tarfile\.open|read_metadata|sha256|hashlib|is_file|resolve|st_size|read|seek)\b' \
scripts/ci/generate_release_sbom.py
echo '== all exact-range diff, for boundary inspection =='
git diff --stat "$base" "$head"
git diff --name-only "$base" "$head"Length of output: 74741
Pass The changed-path boundary matches the allowlist. The descriptor-based parser and hash flow, 256 MiB limit, stable errors, documentation, APA 7 references, and CHANGELOG entry otherwise match the requested scope. I did not approve the pull request.
|
|
@coderabbitai review Review only exact current head |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
base='421c0975cdabbc24cb4c42a9bb11e202cd33b0a4'
head='01a31595eb96ef0b4df46dcfa1b529af9e7a4039'
echo '== Exact commit binding =='
printf 'checked_out='; git rev-parse HEAD
printf 'base_type='; git cat-file -t "$base"
printf 'head_type='; git cat-file -t "$head"
git merge-base --is-ancestor "$base" "$head" && echo 'base_ancestor=yes' || echo 'base_ancestor=no'
echo '== Changed paths in exact range =='
git diff --name-status "$base" "$head"
echo '== Changed-files outlines =='
ast-grep outline scripts/ci/generate_release_sbom.py --items all --view expanded
ast-grep outline tests/test_release_sbom_archive_bound.py --items all --view expanded
echo '== Full permitted-file diff =='
git diff --unified=100 "$base" "$head" -- \
scripts/ci/generate_release_sbom.py \
tests/test_release_sbom_archive_bound.py \
docs/sbom-release-evidence.md \
CHANGELOG.md
echo '== Artifact binding and parser/digest/metadata contexts =='
rg -n -C 12 -P '\b(_open_release_artifact|_sha256_file|build_sbom|main|lstat|fstat|os\.open|O_NOFOLLOW|ZipFile|tarfile\.open|read_metadata|sha256|seek|read|resolve|st_size|stat\.S_ISREG|samefile)\b' \
scripts/ci/generate_release_sbom.py
echo '== Relevant test contexts =='
rg -n -C 10 -P '\b(symlink|replace|mutat|oversiz|parser|ZipFile|tarfile|_sha256_file|main|O_NOFOLLOW|lstat|fstat|256)\b' \
tests/test_release_sbom_archive_bound.py
echo '== Other exact-range changes, if any =='
git diff --name-only "$base" "$head" | grep -Ev '^(scripts/ci/generate_release_sbom\.py|tests/test_release_sbom_archive_bound\.py|docs/sbom-release-evidence\.md|CHANGELOG\.md)$' || true
echo '== Current references in documentation and changelog =='
rg -n -C 4 -P '(CWE-400|zipfile|decompression|256|compressed|mutable|SLSA|Unreleased)' \
docs/sbom-release-evidence.md CHANGELOG.mdLength of output: 109765
The four-file boundary is correct. The descriptor identity comparison, mutation digest bracketing, stable error text, standalone You are interacting with an AI system. |
|
@opencode-agent Implement the bounded GREEN repair on exact current test-only head The exact test-only head adds two valid CodeRabbit regressions and must remain in history:
Modify only:
Required minimal implementation:
Stop without changing anything if the exact head is no longer |
|
@opencode-agent Implement the bounded GREEN repair on exact current lint-clean test-only head This supersedes the earlier request naming head
Modify only:
Required minimal implementation:
Stop without changing anything if the exact head is no longer |
|
@opencode-agent Implement the bounded GREEN repair on exact current head Modify only:
The current head is intentionally RED with exactly two Python 3.10–3.13 regressions: the CLI resolves a final artifact symlink before no-follow validation, and a wheel that grows beyond 256 MiB after the first hash reaches ZIP parsing before the second bounded hash. Required implementation:
No |
|
@opencode-agent Complete the remaining bounded documentation slice on exact current head The production repair is already present and exact-head CI for its source commit succeeded. The current head also documents unresolved final-component validation and live-bounded parser reads/seeks. Modify only Under Stop without changing anything if the exact head is no longer |
|
@opencode-agent Implement the bounded GREEN follow-up on exact current test-only head The new immutable test commit preserves the prior CLI-symlink and post-hash growth regressions and adds two focused parser-reader contracts: a read-all request must be converted to
Required minimal repair:
Do not modify tests, |
|
@opencode-agent Implement the minimal GREEN repair on exact current RED head CI run Modify only In Do not change tests: the exact current RED tests already define the required behavior and branch evidence. Do not modify documentation, CHANGELOG, |
|
@coderabbitai review Review only exact current head Focus on direct wheel/source archive rejection before parser/hash entry; no-follow descriptor/path device+inode binding; live regular-file and exact 256 MiB checks around parser reads/seeks; the remaining-byte-plus-one-tripwire cap for both |
|
@opencode-agent Review only exact current head The exact RED head Independently verify the no-follow descriptor/path identity boundary, live parser read/seek limits, exact finite byte ceiling, descriptor-only parse/hash path, digest bracketing, archive/member/metadata/dependency/deterministic-output controls, stable errors, documentation and CHANGELOG, and absence of workflow, dependency, credential, permission, signing, attestation, release, publication, tag, ref, or network changes. Submit a current-head review outcome only after checking the exact tree and evidence. Keep the PR draft; do not merge, mark ready, enable auto-merge, release, publish, rebase, or retarget. |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
base='421c0975cdabbc24cb4c42a9bb11e202cd33b0a4'
head='ecf15d73783411f3ef0e883a4bbf7d75ee3d1fce'
echo '== exact commit binding =='
printf 'checked_out='; git rev-parse HEAD
printf 'base_type='; git cat-file -t "$base"
printf 'head_type='; git cat-file -t "$head"
git merge-base --is-ancestor "$base" "$head" && echo 'base_ancestor=yes' || echo 'base_ancestor=no'
echo '== complete exact-range changed paths =='
git diff --name-status "$base" "$head"
echo '== implementation structure =='
ast-grep outline scripts/ci/generate_release_sbom.py --items all --view expanded
echo '== focused tests structure =='
ast-grep outline tests/test_release_sbom_archive_bound.py --items all --view expanded
echo '== complete permitted-file diff =='
git diff --unified=100 "$base" "$head" -- \
scripts/ci/generate_release_sbom.py \
tests/test_release_sbom_archive_bound.py \
docs/sbom-release-evidence.md \
CHANGELOG.md
echo '== artifact binding, parser reader, parser, hash, and CLI contexts =='
rg -n -C 12 -P '\b(MAX_RELEASE_ARTIFACT_BYTES|_open_release_artifact|_LiveBoundedArtifactReader|_require_live_artifact_descriptor|_sha256_file|_artifact_metadata|build_sbom|main|lstat|fstat|os\.open|O_NOFOLLOW|ZipFile|tarfile\.open|readinto|read|seek|tell|resolve|sha256)\b' \
scripts/ci/generate_release_sbom.py
echo '== exact regressions and error assertions =='
rg -n -C 8 -P '\b(symlink|grow|growth|read_all|tripwire|remaining|parser|unsafe|exceeds|changed during verification|ZipFile|tarfile|main)\b' \
tests/test_release_sbom_archive_bound.py
echo '== documentation and CHANGELOG claims =='
rg -n -C 8 -P '(256|compressed|unresolved|no-follow|descriptor|read|seek|tripwire|mutable|provenance|SLSA|CWE-400|zipfile|Unreleased|Security)' \
docs/sbom-release-evidence.md CHANGELOG.md
echo '== out-of-allowlist paths, if any =='
git diff --name-only "$base" "$head" | grep -Ev '^(scripts/ci/generate_release_sbom\.py|tests/test_release_sbom_archive_bound\.py|docs/sbom-release-evidence\.md|CHANGELOG\.md)$' || trueLength of output: 138331
The exact range contains only the four allowed files. The unresolved CLI artifact path, no-follow descriptor binding, device/inode checks, descriptor-only parser and hash flow, digest bracketing, archive controls, documentation, APA references, and CHANGELOG entry otherwise match the requested scope. I did not approve the pull request. You are interacting with an AI system. |
|
@coderabbitai review Review only exact current head Focus on direct wheel/source archive rejection before parser/hash entry; no-follow descriptor/path device+inode binding; live regular-file and exact 256 MiB checks around parser reads/seeks; the remaining-byte-plus-one-tripwire cap for |
|
@opencode-agent Review only exact current head The remaining-position RED head Independently verify the no-follow descriptor/path identity boundary, live parser read/seek limits, exact finite byte ceiling, descriptor-only parse/hash path, digest bracketing, archive/member/metadata/dependency/deterministic-output controls, stable errors, documentation and CHANGELOG, and absence of workflow, dependency, credential, permission, signing, attestation, release, publication, tag, ref, or network changes. Submit a current-head review outcome only after checking the exact tree and evidence. Keep the PR draft; do not merge, mark ready, enable auto-merge, release, publish, rebase, or retarget. |
🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
base='fb54b615cbc69ef92c3ac787db1f3faafbc2cba9'
head='224e6d253a7957e981515ec66260fb1c2cf84a31'
first_parent='ecf15d73783411f3ef0e883a4bbf7d75ee3d1fce'
echo '== exact commit binding =='
printf 'checked_out='; git rev-parse HEAD
printf 'base_type='; git cat-file -t "$base"
printf 'head_type='; git cat-file -t "$head"
printf 'head_parents='; git show -s --format='%P' "$head"
git merge-base --is-ancestor "$base" "$head" && echo 'base_ancestor=yes' || echo 'base_ancestor=no'
git merge-base --is-ancestor "$first_parent" "$head" && echo 'first_parent_ancestor=yes' || echo 'first_parent_ancestor=no'
echo '== complete PR changed paths: base..head =='
git diff --name-status "$base" "$head"
echo '== merge import: first-parent..merge =='
git diff --name-status "$first_parent" "$head"
git diff --unified=80 "$first_parent" "$head"
echo '== complete permitted-file diff: base..head =='
git diff --unified=100 "$base" "$head" -- \
scripts/ci/generate_release_sbom.py \
tests/test_release_sbom_archive_bound.py \
docs/sbom-release-evidence.md \
CHANGELOG.md
echo '== changed paths outside intended four-file PR boundary =='
git diff --name-only "$base" "$head" | grep -Ev '^(scripts/ci/generate_release_sbom\.py|tests/test_release_sbom_archive_bound\.py|docs/sbom-release-evidence\.md|CHANGELOG\.md)$' || true
echo '== production structure =='
ast-grep outline scripts/ci/generate_release_sbom.py --items all --view expanded
echo '== descriptor, reader, parser, hash, and CLI contexts =='
rg -n -C 12 -P '\b(MAX_RELEASE_ARTIFACT_BYTES|_open_release_artifact|_LiveBoundedArtifactReader|_require_live_artifact_descriptor|_sha256_file|_artifact_metadata|build_sbom|main|lstat|fstat|os\.open|O_NOFOLLOW|ZipFile|tarfile\.open|readinto|read|seek|tell|resolve|sha256|st_dev|st_ino)\b' \
scripts/ci/generate_release_sbom.py
echo '== exact artifact-bound regression contexts =='
ast-grep outline tests/test_release_sbom_archive_bound.py --items all --view expanded
rg -n -C 10 -P '\b(symlink|growth|grow|read_all|tripwire|remaining|parser|unsafe|exceeds|changed during verification|ZipFile|tarfile|main|seek|tell|OSError)\b' \
tests/test_release_sbom_archive_bound.py
echo '== documentation and CHANGELOG claim contexts =='
rg -n -C 8 -P '(256|compressed|unresolved|no-follow|descriptor|read|seek|tripwire|mutable|provenance|SLSA|CWE-400|zipfile|Unreleased|Security)' \
docs/sbom-release-evidence.md CHANGELOG.mdLength of output: 143994
The requested merge verification passed. The merge has the stated two parents. Relative to its first parent, it imports only The unresolved artifact path, no-follow descriptor binding, device/inode comparison, descriptor-only parser and hash flow, digest bracketing, archive controls, documentation, APA references, and CHANGELOG entry otherwise match the requested scope. I did not approve the pull request.
|
|
@opencode-agent Apply the bounded GREEN implementation for the immutable RED head Modify only Required behavior:
Run the focused archive-bound tests, complete Python 3.10–3.13 suite, Ruff, compileall, public-docstring contract, 100% production statement and branch coverage, and package acceptance on the resulting exact head. Do not modify tests, docs, CHANGELOG, |
|
@opencode-agent Apply only the documentation and changelog completion to exact current head Modify only:
Required bounded edits:
Do not modify scripts, tests, |
|
@opencode-agent Supersede the earlier documentation-only request and apply this exact bounded completion to current head Modify only:
Required edits:
Run Ruff/format checks and the focused |
Test-first direct-generator hardening
Progresses #67 as a bounded stack on PR #64 without modifying
.github, credentials, dependencies, release permissions, protected refs, network transports, or files owned by the stacked base.Exact tree binding
fb54b615cbc69ef92c3ac787db1f3faafbc2cba9.224e6d253a7957e981515ec66260fb1c2cf84a31.d5e073f799c459fa7a3f195018802d5958b5ef1e.127e4577ea31ca20e7260a482343c892efeed6f9.961abb78b9df1fd3dba0dd23582c8379d845556c.The stacked base has advanced after the auditable merge, so GitHub currently reports this draft PR as conflicting. No rebase, force update, retarget, or conflict strategy has been used. The branch remains draft until an auditable credential-separated stack-integration mechanism can reproduce and independently verify the exact tree.
Implemented boundary
fileno,tell,read, andseekfailures to one non-leaking unsafe-artifact boundary, and rejects booleans, non-integer, negative, or out-of-range positions before bound arithmetic or parser consumption;Test-first evidence
Exact RED commit
d5e073f799c459fa7a3f195018802d5958b5ef1eadded focused regressions proving that:read(-1)or other unsafe size can occur;fileno,tell,read, andseekfailures must use one stable non-leaking error.Exact current commit
127e4577ea31ca20e7260a482343c892efeed6f9changes onlyscripts/ci/generate_release_sbom.pyrelative to that RED head and implements the bounded descriptor/position validation and stable failure normalization.The current conflicted stack cannot produce the repository's normal pull-request merge-ref CI, so no queued, missing, or prior-head run is treated as exact-current-head success. Prior CI run
31103515511succeeded on224e6d253a7957e981515ec66260fb1c2cf84a31, but it predates the parser-state RED/GREEN extension and is not acceptance evidence for127e4577ea31ca20e7260a482343c892efeed6f9.Remaining gates
Keep this PR draft. Complete the bounded docs/CHANGELOG formatting pass, then require an auditable stack integration, exact-current-head CI, applicable SAST and Security Scan, completed automated review, independent non-author approval, branch protection, and every repository policy gate. Do not merge, enable auto-merge, release, publish, rebase, retarget, force-update, or claim provenance or a SLSA Build level.