fix(api): reject duplicate decoded target_repository keys - #103
Draft
seonghobae wants to merge 3 commits into
Draft
fix(api): reject duplicate decoded target_repository keys#103seonghobae wants to merge 3 commits into
seonghobae wants to merge 3 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:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
16 tasks
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.
Purpose
Fail closed when a bounded
POST /exchangeJSON body contains more than one decodedtarget_repositorymember name before GitHub API trust setup or credential-bearing work can observe ordinary last-key-wins parsing.Stack identity
main:c85d710804139c0697d7ef8fa47d02b1389e6d84;fix/exchange-method-short-circuit-on-main/ PR fix(api): reject unsupported exchange methods before side effects #101;50af2026b30693524d5307b4e9449c888d4dc8b8;abdb8aa55c392d74a5eac7a3b443e4f41f953a24;e15eabce06609c585fcd10a7e916c126fd462771;ecd42efbc4c2dc21804faa0b4e317b83e59141cb.This remains a Draft because it is dependency-ordered behind #101. Its feature-branch base is not eligible for the current central Security Scan pull-request trigger, so scanner evidence is non-passing
defer_until_triggeruntil the work is refreshed onto an eligible protected-base lineage.RCA -> RED -> GREEN -> proof
The first failing boundary was body-integrity validation.
boundExchangeJsonBody()enforced byte limits, then downstream parsing used normal JSON semantics. A body containing bothtarget_repositoryand escape-equivalenttarget_reposit\u006frytherefore had an ambiguous security-relevant member identity and could reach last-key-wins parsing.Exact RED head
abdb8aa55c392d74a5eac7a3b443e4f41f953a24was checked out by application CI run31407630318. Existing tests remained green while the new regression failed exactly because the bounded request was accepted instead of returning400 duplicate_keys.The narrow GREEN implementation at
e15eabce06609c585fcd10a7e916c126fd462771scans only decoded JSON member names relevant totarget_repository, rejects a second occurrence before GitHub egress/configuration work, and emits the existing no-store validation response/logging contract. Application CI run31407827784then proved all behavior tests green but correctly failed the repository's exact 100% coverage gate on one defensive scanner branch; the run was not promoted to passing evidence.Current head
ecd42efbc4c2dc21804faa0b4e317b83e59141cbadds realistic coverage for unrelated member names, malformed key escapes delegated to the existing downstream JSON parser, and the full entrypoint fail-closed response before GitHub egress configuration.Current exact-head technical evidence
For unchanged head
ecd42efbc4c2dc21804faa0b4e317b83e59141cb:cirun31408260346: terminal success; verify job93519804541checked out the exact head;reviewer-cirun31408260681: terminal success;release:verify: 64 test files / 656 tests passed;npm audit --audit-level=high: 0 vulnerabilities;Security Scan: absent because this PR targets a feature branch, therefore non-passingdefer_until_trigger, not scanner success.The non-strict KPI step still reports
SKIPbecause real 30-day production exchange evidence is absent. Acquisition-manifest generation succeeds only as manifest construction and still identifies missing final-gate production KPI/provenance, security-validation, immutable release-publication, deployment/attestation/environment-governance, revenue, and transfer evidence. None of those results are acquisition readiness.Behavioral boundary
The implementation intentionally guards the security-relevant
target_repositorymember rather than claiming a general duplicate-key JSON parser. It preserves request byte limits, malformed-JSON handling, OIDC/JWT bounds, distributed rate limiting, exact workflow trust, replay behavior, GitHub API egress policy, token minting semantics, dependency/workflow permissions, licensing, release, and deployment authority.Merge / authority boundary
No predecessor check or review evidence transfers after source movement. Before this work can become merge-eligible, #101 must reach the protected lineage under live governance, this unique two-file delta must be refreshed/rebuilt onto the then-current eligible base without destructive history rewriting, and fresh application/reviewer/central Security Scan/current-review evidence must pass on that exact head. Live #27 governance and any qualifying independent non-author formal approval required by #29 remain separate fail-closed authority. No self-approval, protection weakening, synthetic status, release, deployment, outbound-license decision, or acquisition-readiness claim is made.