fix: CodeQL Highs (#107, #88–#106) and prepare GHSA-8hp3 / GHSA-3mgh - #5401
Draft
Hmbown wants to merge 2 commits into
Draft
fix: CodeQL Highs (#107, #88–#106) and prepare GHSA-8hp3 / GHSA-3mgh#5401Hmbown wants to merge 2 commits into
Hmbown wants to merge 2 commits into
Conversation
CodeQL #107 flagged scripts/catalog_models_dev.py:400 as clear-text logging of sensitive information. Drift compared bundled limits to the live Models.dev document and printed the upstream value with !r. Remote JSON is tainted; a credential-shaped field would land in CI logs. Format limit.context / limit.output as a number, null, or the constant "redacted". Strip query and fragment from the upstream source label. Never print tokens. Verified: python3 scripts/catalog_models_dev_test.py (8 tests). Co-authored-by: Hunter Bown <Hmbown@users.noreply.github.com>
CodeQL #88-#106 (actions/cache-poisoning/poisonable-step) flagged release, candidate, and artifact jobs that checked out inputs.source_sha or needs.resolve.outputs.sha and then ran cargo/npm after rust-cache or setup-node cache. The query treats workflow_call checkout-with-ref as an untrusted checkout, and any ref whose name matches *sha* the same way. workflow_dispatch is modeled as default-branch cache write. resolve already proves the requested SHA equals github.sha, so later jobs checkout the workflow SHA with no ref. Pin rust-cache to runner OS + arch + explicit stable toolchain; rust-cache still hashes Cargo.lock and rust-toolchain.toml from that trusted tree. Never interpolate github.event, github.ref, github.sha, or inputs into those keys. Disable setup-node's implicit npm cache on artifact assemble/smoke. Caller source_sha is compared in env only and cannot retarget checkout or caches. Verified: node .github/scripts/release-workflows.test.js Co-authored-by: Hunter Bown <Hmbown@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CodeQL + GHSA slice only. Does not tag v0.9.8, publish crates/npm/Homebrew, or retag
2acbd5376/5ac75add4.CodeQL #107 (High, clear-text logging) —
scripts/catalog_models_dev.pydrift printed remote catalog limit values. Those values are now numbers,null, or the constantredacted. Source URLs drop query/fragment. Tokens never reach stdout.CodeQL #88–#106 (High, cache poisoning via untrusted code) — Read
actions/cache-poisoning/poisonable-stepand the YAML. The query treatsworkflow_callcheckout-with-refas an untrusted checkout, and any ref whose name matches*sha*the same way.workflow_dispatchis default-branch cache write.resolvealready proves the requested SHA equalsgithub.sha. Later jobs now checkout the workflow SHA with noref:. rust-cache keys are runner OS + arch + explicitstable+ rust-cache'sCargo.lock/rust-toolchain.tomlhash.github.event/github.ref/github.sha/inputs.*are not cache keys. setup-node's implicit npm cache is off on artifact assemble/smoke. Callersource_shais compared in env only and cannot retarget checkout or caches.GHSAs — both already patched on
mainin208421b9d(first tagged release: v0.9.0). This token cannot read or publish draft advisories (403on GET and PATCH). Public advisory URLs 404 (consistent with unpublished drafts). Payloads with those verified ranges are prepared; publish is stopped. No invented CVEs. No new exploit PoCs.Testing
python3 scripts/catalog_models_dev_test.py(8 tests)node .github/scripts/release-workflows.test.jscargo fmt --all -- --check(no Rust source in this slice)cargo clippy --workspace --all-targets --all-features --locked(no Rust source in this slice)cargo test --workspace --all-features --locked(no Rust source in this slice; localcodewhale-tuilib build hit a missing C++cstringheader in this VM)Checklist
v098-final harvest
Cherry-pick in order onto the local lane. Do not take tags or publish commits (there are none).
ae088b4a49c8869b981fc0ff1b7405a08f027ea4— catalog redactb379d7ec6ff9acfe522c746218191215240e6cd1— release cache pin