Skip to content

fix(security): accept a compact-JWS client_id on an approved OAuth endpoint - #12796

Closed
zachary-povey wants to merge 1 commit into
kirodotdev:mainfrom
zachary-povey:fix/oauth-jwt-client-id
Closed

zachary-povey wants to merge 1 commit into
kirodotdev:mainfrom
zachary-povey:fix/oauth-jwt-client-id

Conversation

@zachary-povey

@zachary-povey zachary-povey commented Sep 22, 2026 •

Copy link
Copy Markdown

Problem / Motivation

An MCP server whose dynamic client registration issues a client_id shaped like a compact JWS cannot be authorized at all, and no configuration can fix it.

What the user observes is the fail-closed banner — "authentication failed: URL contained credential or exfiltration pattern" — with no URL in either the log line or the banner meta, so the cause is not diagnosable from inside the product.

ClickUp's MCP server is the concrete case. Its DCR mints mcp-client-eyJ…, whose payload declares "tokenType":"jwt_client_id". Two URLs identical but for the shape of that one parameter:

client_id verdict rule
compact JWS rejected fixed_credential_raw (param client_id)
opaque accepted —

Why it matters

The provider is unusable — sign-in cannot be completed by any route — and the operator escape hatch does not help. A correct, byte-exact oauth_endpoints.json entry produces zero oauth_endpoint_extension_used events in security_events.jsonl, not because the file is rejected but because the code path never consults it. Diagnosing that took reading the gate's source and extracting the authorize URL from a different client; a user cannot get there from the product.

RFC 7591 places no constraint on the format of a dynamically registered client_id, so this is not ClickUp-specific: it hits any provider that issues a structured identifier. kiro-cli is unaffected because it has no equivalent gate, which makes the failure look like a Kiro Crew regression to a user who has the same server working elsewhere.

What changed (motivation → approach → change)

Symptom — a compact-JWS client_id is rejected at an endpoint that is otherwise approved.

Root cause — _contains_fixed_credential matches any eyJ-prefixed three-segment base64url run, which is the JWT/JWE signature. In diagnose_oauth_url_credential it was evaluated against the raw URL before endpoint approval was computed, so it short-circuited with fixed_credential_raw and _approved_oauth_authorization_endpoint was never reached. The identifier authenticates nothing on its own and is being sent to the very issuer that minted it, so the match is a false positive — but one the rule could not see, because it ran before the information that would exempt it.

Change — evaluate the signature against the same target the markerless scan uses, and blank a client_id there only when it keeps the compact-JWS shape at an exact approved endpoint.

_oauth_client_id_is_jws_shaped requires base64url (so a standard-base64 +// run cannot ride it) and exactly two separators (so a singly dotted identifier does not match), and re-validates every decoded form — the same decode-until-stable discipline _oauth_entropy_value_is_protocol_shaped already applies, so a double-encoded payload cannot smuggle a credential-shaped run into the blanked value.

The carve-out is applied at all three sites that judge the URL: the pre-check, the markerless scan target, and the payload handed to _exfil_url_warning. Missing any one of them only moves the rejection to a different rule, which is what the first two drafts of this change did.

mcp.clickup.com + /oauth/authorize is added to _OAUTH_AUTHORIZATION_ENDPOINTS, taken from ClickUp's RFC 8414 metadata at https://mcp.clickup.com/.well-known/oauth-authorization-server, reached by RFC 9728 discovery from https://mcp.clickup.com/mcp.

What this deliberately does not widen. _exfil_url_warning's credential signatures stay unconditional for everything except that one identifier — they remain the backstop that catches a marker hidden inside an entropy-bearing parameter. An earlier draft reused the general scan target there and silently removed that backstop; the narrowing is deliberate and is pinned by a test.

The tradeoff, stated plainly: a genuine JWT placed in client_id at an approved endpoint is now exempt from credential scanning. The destination is a code-owned or operator-vouched consent endpoint, and this is the same tradeoff already accepted for state and nonce. Reviewers should weigh that explicitly rather than take it as free.

Backwards compatibility

Compatible: the change only accepts input that main rejects. No field becomes required, no validator is tightened, no type is narrowed, and no key is renamed or removed — every URL main accepts today is still accepted, with identical diagnostic rule names for every input that is not an approved-endpoint URL carrying a JWS client_id.

Tests

test/oauth_url_corpus.py gains a ClickUp entry — the regression guard for a provider whose identifier carries the JWT signature shape. It fails on unpatched main (both corpus tests, test_corpus_url_not_flagged_as_credential and test_corpus_url_renders_banner) and passes with the fix.

TestJwsClientIdCarveOut in test/test_mcp_oauth_banner.py locks in the boundaries: 13 cases, 2 accepting and 11 rejecting, each rejection differing from the accepted URL in exactly one way.

  • Endpoint and parameter identity are required: unapproved host, unapproved path, explicit port, http scheme, case-variant parameter name.
  • Only the compact-JWS shape earns the exemption: credential marker as the value, single separator, standard-base64 alphabet, double-encoded value.
  • The carve-out removes the identifier from scope, not the query: a marker in state beside a valid JWS client_id is still caught, and so is one in an unknown parameter.

All JWS segments in the tests are synthetic; the payload decodes to {"tokenType":"jwt_client_id","iss":"example-mcp-server"} and the signature is filler.

Manual verification

Reproduced the original defect and the fix against a real ClickUp authorize URL shape with KIROCREW_HOME pointed at an empty directory, confirming the accept comes from the builtin allowlist and not from a local oauth_endpoints.json. Verified the rejection moved through each gate in turn while the carve-out was incomplete (fixed_credential_raw → exfil_fixed_credential → credential_scan_fixed_raw → accepted), which is what established that all three sites need it.

End-to-end banner rendering is covered automatically by test_corpus_url_renders_banner, which asserts the live banner carries a clickable oauth_url rather than a rejection.

Not exercised against ClickUp's live consent flow: that needs a ClickUp account and a real DCR round-trip.

Related Issues

None — no issue was filed for this; the defect was diagnosed and fixed directly. Happy to open one first if maintainers prefer that order.

Pattern harvest

Rule candidate: review-prompt

Pattern: an unconditional signature check evaluated before the approval context that would scope it — and, once a carve-out exists, applied at only some of the sites that judge the same input. Both halves showed up here: the fixed-credential check ran ahead of approved_endpoint, and the first two drafts fixed one site at a time while the rejection simply reappeared under the next rule name. A reviewer prompt worth adding: when a gate gains a conditional exemption, ask which other call sites evaluate the same input, and whether the ordering lets the exemption be seen at all.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable) — N/A, no user-facing documented behaviour changes; the rationale lives in the module comments
  • No secrets, credentials, or internal references in the diff

Verification run locally: pytest 12,459 passed / 16 skipped (81 related backend files via scripts/local-gate.py); vitest 36,848 passed (full frontend suite) and 8,718 passed (related subset); tsc -b, isort, flake8 clean; mypy 1.14.1 (matching the pyproject.toml pin) Success: no issues found in 1685 source files; scripts/local-gate.py --base origin/main exit 0.

The full 126,672-test backend suite was not run locally: xdist_budget.py estimates ~16 GiB per worker and this host had 8–11 GiB of 36 GiB free, so it clamped to a single worker and the run was heading for hours. The diff-scoped gate states the full suite is deferred to CI by design.

Rebased onto cbdfa743e; none of the intervening commits touch the changed files.

Contribution License Agreement

The template carries a placeholder here pending OSPO wording, so there is nothing to affirm yet. Happy to sign whatever is required once it is published.

…dpoint

An MCP server whose dynamic client registration issues a client_id shaped
like a compact JWS could not be authorized at all. The fixed-credential
signature matches any eyJ-prefixed three-segment base64url run, and it was
evaluated against the raw URL before endpoint approval was known, so the
banner failed closed with no configuration remedy: the operator endpoint
extension never took effect because the code path did not reach the endpoint
check. RFC 7591 constrains the format of a registered identifier not at all,
so this affects any provider that issues a structured one.

Evaluate the signature against the same target the markerless scan uses, and
blank a client_id there only when it keeps the compact-JWS shape at an exact
approved endpoint. The shape test requires base64url and exactly two
separators and re-checks every decoded form, so a standard-base64 run or a
double-encoded payload cannot ride it.

The exfil warning's own signatures stay unconditional apart from that one
identifier -- they remain the backstop that catches a marker hidden inside an
entropy-bearing parameter such as state.

Add ClickUp's authorization endpoint, taken from its RFC 8414 metadata, and
pin the carve-out's boundaries: each rejection case in the new test class
differs from the accepted URL in exactly one way.
@zachary-povey
zachary-povey requested review from a team and krishdhasmana September 22, 2026 12:26
@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Sep 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Fable 5, fork) — 🟡 CONCERNS

Design-level review of 011274721b6228a99666b1e5434898461f1d6370 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: CONCERNS

security.md still promises fixed-credential scanning stays unconditional at approved endpoints; this PR falsifies that guarantee without updating the owning spec.

Watch

The spec's oauth-extension passage (docs/system-specs/modules/security.md:558) says "the exemption grants exactly what the builtin set grants — fixed-credential patterns … remain unconditional." The new JWS client_id carve-out makes that false, and because the carve-out keys on _approved_oauth_authorization_endpoint, every operator-added oauth_endpoints.json entry now also grants a credential-signature exemption the spec says that file cannot grant. A future contributor or security reviewer trusting the spec will either re-tighten the gate (re-breaking ClickUp) or misjudge the trust boundary that file widens.
Clears when: the security.md oauth passage (and the diagnostics paragraph if the credential_target change affects it) is updated in this PR to state the JWS client_id exemption and its scope over operator-extended endpoints.

[DESIGN-REVIEWED] 0112747

@github-actions

Copy link
Copy Markdown
Contributor

GPT 5.6 Review (fork) — 🔴 changes requested (blocking)

Reviewed 011274721b6228a99666b1e5434898461f1d6370 via the fork AI-review pipeline; updated in place on each push.

1 of 1 blocking finding(s) are security-class and were withheld from adjudication, so the blocking verdict stands.

BLOCKING -- src/kiro_crew/security/exfil.py:1237 -- JWS-shaped client IDs bypass credential scanning
and _oauth_client_id_is_jws_shaped(value)
segments.append(f"{key}{separator}" if blank else segment)
client_id=aaa.[REDACTED-AWS-KEY-ID].bbb -> OAuth banner validation -> value blanked from every credential scan -> Authorize link transmits the AWS key.
Anchor: residual/security
Fix: Exempt only the JWS signature match while retaining all other fixed-credential checks on client_id.
[BLOCK-MERGE] 0112747
[GPT-REVIEWED] 0112747

Adjudication (Opus 4.8) — is blocking on each finding proportionate?

The adjudicable block is empty (0 findings). One fenced finding, F1.

F1 — harm rung: UNBOUNDED (fixed-credential exposure, the class the OAuth exfil scanner exists to catch). Conditions I confirmed from code opened this run: (a) at an approved endpoint the credential precheck now scans _oauth_credential_precheck_target(url), which blanks a JWS-shaped client_id before the raw/decoded fixed-credential checks (exfil.py:1201-1215 new form via diff; _blank_jws_client_id/_oauth_client_id_is_jws_shaped at diff 103-120, 81-100); (b) the same value is also stripped from the markerless scan target (_oauth_credential_scan_target, diff 68-74) and from the exfil-warning query (diff 190); (c) _OAUTH_JWS_CLIENT_ID_RE matches any three base64url segments, and an AWS key id (AKIA…, uppercase+digits) is base64url-safe, so aaa.AKIA….bbb satisfies the shape and every segment — including a real credential in the middle — is blanked. The author's boundary tests cover _MARKER alone and aaa.{_MARKER} (two segments) but conspicuously never the three-segment aaa.{_MARKER}.bbb form, i.e. the exact bypass claimed.

Rarity/recovery for a FLAG: the condition combination is not extreme — a three-segment client_id carrying a credential segment at an approved endpoint is producible by precisely the adversary this scanner defends against (an agent induced to build an authorize URL). The only mitigant is that the destination is an allowlisted provider, which lowers but does not close credential egress and is not "an input the system's writer cannot produce." I cannot complete a rarity record that a human would accept, and this is the credential class where a wrong clearance is unrecoverable — so UPHOLD-FENCED.

[ADJUDICATION] 0112747 total=0 uphold=0 downgrade=0
[GPT-ADJUDICATED] 0112747
[ADJUDICATION-FENCED] 0112747 fenced=1 flagged=0
UPHOLD-FENCED F1 src/kiro_crew/security/exfil.py:1237 -- A three-segment base64url client_id can carry a real AWS key in a segment; the carve-out blanks it from every credential scan at an approved endpoint, and that input is producible by the exact adversary the scanner defends against.
[GPT-ADJUDICATED-FENCED] 0112747

@github-actions

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5, fork) — ✅ PASS

Premise-level review of 011274721b6228a99666b1e5434898461f1d6370 via the fork AI-review pipeline — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: PASS

Confirm ClickUp's RFC 8414 metadata names mcp.clickup.com/oauth/authorize, and weigh the declared tradeoff: a genuine JWT in client_id there is now unscanned.

What this change ships

Inventory (5 items) — 5 justified

Intent: let sign-in complete for an MCP provider whose dynamically registered client_id is a compact JWS — a FIX, with a failing-on-base corpus test as provenance.

  1. ClickUp MCP's consent URL now shows the sign-in banner instead of the fail-closed rejection — justified
  2. A compact-JWS client_id at an exact approved HTTPS endpoint is no longer rejected as a credential — justified
  3. Operator-allowlisted endpoints (oauth_endpoints.json) grant the same JWS exemption — justified
  4. The exfil backstop still scans everything at approved endpoints except that one identifier — justified
  5. Regression corpus entry plus a 13-case boundary test class — justified

[FIRST-PRINCIPLES-REVIEWED] 0112747

@github-actions

Copy link
Copy Markdown
Contributor

Opus 4.8 Review (fork) — 🔴 changes requested (blocking)

Reviewed 011274721b6228a99666b1e5434898461f1d6370 via the fork AI-review pipeline; updated in place on each push.

BLOCKING — the JWS client_id carve-out removes AWS-key detection from OAuth URLs at every approved endpoint, with no remaining layer that catches it.

[BLOCK-MERGE] 0112747

BLOCKING — src/kiro_crew/security/exfil.py:1120 (_OAUTH_JWS_CLIENT_ID_RE)

_OAUTH_JWS_CLIENT_ID_RE = re.compile(
    r"[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\Z"
)

Input https://mcp.clickup.com/oauth/authorize?...&client_id=aa.[REDACTED-AWS-KEY-ID].bb&... → _oauth_credential_precheck_target sees an approved endpoint and _oauth_client_id_is_jws_shaped("aa.[REDACTED-AWS-KEY-ID].bb") fullmatches (three base64url segments, unquote unchanged) → client_id is blanked before _contains_fixed_credential, and the same _blank_jws_client_id also blanks it in _oauth_credential_scan_target and in exfil_query, so every detection layer misses the embedded AKIA… run → oauth_url_contains_credential returns False, where the pre-PR _contains_fixed_credential(url) on the raw URL rejected it. The regex omits the eyJ header that JWT_MULTI_SEGMENT requires, so it exempts any three-segment base64url value — including one carrying an AWS access-key-ID signature — not just real JWTs, defeating the file's own stated contract ("legitimate OAuth consent URLs carry … client_id, never AKIA*/Bearer/etc."). No compensating layer catches it.
Fix: anchor _OAUTH_JWS_CLIENT_ID_RE on a real JWT header (require the first segment to contain eyJ, matching JWT_MULTI_SEGMENT), so only genuine JWT-shaped identifiers earn the exemption and a client_id embedding an AKIA… run is still detected.

[OPUS-REVIEWED] 0112747

@github-actions

Copy link
Copy Markdown
Contributor

Security Scope Review (fork) — 🟡 CONCERNS

Which legitimate operations does 011274721b6228a99666b1e5434898461f1d6370 newly refuse? Model proposes, scripts/deny_diff.py decides — updated in place on each push. A script-confirmed regression blocks PR readiness.

the reviewer's own judgement; no confirmed regression

Scope-Verdict: CONCERNS

TIGHTENING: No shell-side mechanism got stricter — every hunk in src/kiro_crew/security/exfil.py is subtractive on the OAuth URL gate: it adds ("mcp.clickup.com", "/oauth/authorize") to the approved-endpoint set and blanks a compact-JWS-shaped client_id out of the fixed-credential and exfil-warning scan targets at exact approved endpoints. The one threat the change keeps refused is a credential-shaped value anywhere else in the request, per the hunk it lives in: "The exfil warning's credential signatures are unconditional by design -- they are the backstop that still catches a marker hidden inside an entropy-bearing parameter. Only the approved endpoint's JWS identifier is withheld from them; every other parameter is handed over verbatim." A non-approved host or path, an explicit port, an http scheme, a mixed-case Client_Id, a single-dot or standard-base64 identifier, and a marker in state or an unknown parameter all remain in scope, and the new tests pin each of those boundaries as still refused.

ADJUDICATED: 9 candidates submitted, 0 confirmed newly-refused handed to this review. The candidates cover the maintainers' daily operations in the touched area (running test/test_mcp_oauth_banner.py, grepping and diffing src/kiro_crew/security/exfil.py, fetching the two providers' RFC 8414 metadata the endpoint list is audited against) and the sharpest boundary shapes (a shell line carrying the diff's own synthetic ClickUp authorize URL with the JWS client_id, and a lone base64url eyJ segment being decoded for review). No verdict was available at review time; a regression without a verdict is not a finding.

PLATFORM COVERAGE: Candidates were written in three spellings. any for the two curl metadata fetches, whose strings carry no path, separator, or platform-specific executable name. posix for the .venv/bin/python -m pytest run, the git grep/git diff reads with / separators, and the two python -c repro rows whose single-quote shell quoting is POSIX. windows for the .venv\Scripts\python.exe -m pytest run and the Select-String search over the same touched file. The diff itself makes no platform assumption — it is pure URL-string logic (urlparse, a base64url regex, percent-decoding) with no path, argv, interpreter, or environment-variable shape — so no assumed spelling goes unprobed. The one spelling not written is a cmd.exe form of the python -c repro rows, whose nested-quote literal does not survive that tokenizer verbatim; the operation itself is covered on Windows by the pytest row, which runs the same reproduction as a test. Per-leg verdicts are the deterministic fold's to report, by leg name, after this review is captured.

UNADJUDICATED: The entire change lives in a URL gate the classifier cannot see: diagnose_oauth_url_credential / oauth_url_contains_credential in src/kiro_crew/security/exfil.py, plus its new helpers _oauth_client_id_is_jws_shaped, _blank_jws_client_id, and _oauth_credential_precheck_target. The call paths an input takes to reach it are the ACP banner-safety gate (src/kiro_crew/dashboard/chat_runner.py:2632, src/kiro_crew/dashboard/chat_utils.py:1743) and the connection warm/mint URL vetting (src/kiro_crew/connections/mint.py:905, src/kiro_crew/connections/warm.py:2545) — an OAuth authorization URL arrives there from a provider, never as a shell command. The shell composite's exfiltration tier is audit_bash_exfiltration (src/kiro_crew/security/exfil.py:1504), which matches only _BASH_EXFIL_PATTERNS/_BASH_EXFIL_RES against the command string, and the general text scanner scan_exfiltration_urls leaves the OAuth carve-out disabled — so no shell row can exercise any changed branch, and the adjudicated set measures only that the surrounding daily operations did not move. The candidate legitimate inputs I would have submitted to the gate itself, in prose: the ClickUp authorize URL with the JWS client_id (the corpus entry the diff adds); the same URL with an opaque client_id; a JWS-shaped client_id at the other approved endpoints (mcp.linear.app/authorize, gitlab.com/oauth/authorize), because the carve-out is keyed to the whole approved set, not to ClickUp alone; and the mixed-case, single-dot, standard-base64, and double-encoded identifier forms, which must stay refused. On direction: every changed branch either blanks bytes out of a scan target or grows the approval set, so an allowed-to-refused flip at this gate would require a fixed-credential signature spanning the =/& seam that blanking creates — an argument I can make but not confirm with a verdict, which is why the verdict is CONCERNS rather than PASS.

[SCOPE-REVIEWED] 0112747

Security scope review -- adjudicated candidates

  • macos-latest (platform posix): 7 classified, 0 newly refused, 7 still allowed.
  • ubuntu-latest (platform posix): 7 classified, 0 newly refused, 7 still allowed.
  • windows-latest (platform windows): 4 classified, 0 newly refused, 4 still allowed.

No candidate flipped from allowed to refused.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Sep 23, 2026
@dwu96 dwu96 added the needs-pr-triage PR scanner: awaiting automated triage label Sep 26, 2026
@NicholasRBowers NicholasRBowers added drive-to-green PR claimed by drive-to-green pipeline and removed needs-pr-triage PR scanner: awaiting automated triage labels Sep 26, 2026
@NicholasRBowers

Copy link
Copy Markdown
Contributor

🤖 Kiro Crew [operator: NicholasRBowers#a942f9ca]: This PR was flagged for automated triage with failing CI. I've assessed the blockers and they appear resolvable — I'll push fixes directly to this branch as a co-author.

Assessment: the blocking finding is real and reproducible, and its fix sits inside your stated intent rather than against it. GPT 5.6 (span=40b4e3d07714, exfil.py:1237) and Opus 4.8 (span=ec9ed038f45d, exfil.py:1120) both block because _OAUTH_JWS_CLIENT_ID_RE accepts any three-segment base64url value and the match then blanks that value at all three scan sites, for every approved endpoint including operator oauth_endpoints.json entries. Triage reproduced it at this head: client_id=aa.AKIA….bb and client_id=ghp_<36>.a.b at mcp.clickup.com both give oauth_url_contains_credential=False, and at mcp.linear.app main returns True where this branch returns False; a bare AKIA client_id and an AKIA in state are still correctly rejected, so the leak is specific to the new carve-out. That is wider than the tradeoff your description declares ("a genuine JWT"), which makes it a defect rather than the policy call. The fix is to stop blanking: on a JWS-shaped client_id, drop only the JWT_MULTI_SEGMENT alternative and keep the remaining _CREDENTIAL_PATTERNS and _decode_b64_safe checks on its raw and decoded forms, plus rejection tests for aa.<AKIA>.bb and eyJ….<AKIA>.sig. Worth recording: Opus's suggested remedy of anchoring on eyJ does not close this — triage confirmed eyJhbGciOiJIUzI1NiJ9.<AKIA>.c2ln and mcp-client-eyJ….eyJ….<AKIA> still pass it.

The rest is mechanical. Backend Lint & Type Check (3.12) is a black gate on two of your own new hunks (the regex at ~1120 and blank = (...) at ~1234). The conflict is one hunk in exfil.py at diagnose_oauth_url_credential, where main's fa3cf77 (#12972) added assume_approved_endpoint and oauth_rejection_is_endpoint_exemptible; the textual union is trivial, but a plain union would defeat your own goal, because _oauth_credential_precheck_target calls _approved_oauth_authorization_endpoint directly and so ignores the new flag — oauth_rejection_is_endpoint_exemptible would then return False for a JWS client_id at an unlisted endpoint and the mint card would not name the endpoint, which is the "unfixable" symptom this PR exists to remove. I'll thread the flag into the precheck. Design Review's Watch (span=4a332829c935) is spec drift: the passage at docs/system-specs/modules/security.md:648 on main still says fixed-credential patterns remain unconditional, and this PR doesn't update it. PR Hygiene is stale — its logged body predates your ## Pattern harvest section and its rerun was cancelled by concurrency, so it passes on the next run; the SAST, Screenshot Evidence, Automated Rule Check and Inclusive Language rows are superseded duplicate runs with successful replacements, and every backend, frontend, E2E and Windows shard passed.

One thing I will not decide for you: after the narrowing above, a genuine JWT in client_id at an approved or operator endpoint is still exempt from the multi-segment heuristic specifically. That is the tradeoff you asked reviewers to weigh explicitly, and it stays yours or a maintainer's. If the fenced lane re-raises on the new head rather than accepting the narrowed exemption, I'll stop and hand it back — a fenced security finding clears only by a fix or by a repository writer recording an override, and I will never self-authorize one.

If you'd prefer I don't touch this PR, add the pr-no-autofix label.

Copy link
Copy Markdown
Contributor

PR triage (automated, evidence-based): closing as DUPLICATE of #16816

#16816 (open PR, not an issue) re-lands this PR's commit on a clean main. It keeps the same title and goal, touches the same three files (src/kiro_crew/security/exfil.py, test/oauth_url_corpus.py, test/test_mcp_oauth_banner.py) and preserves @zachary-povey's authorship: commit b5f488de89 has Author: Zachary Povey plus a Co-authored-by trailer. Its description says "Supersedes #12796". Review of this change now continues there, and it is tracked by issue #16815.

What I checked, at head 011274721b against origin/main cc7e79894e:

client_id at endpoint main this PR #16816
synthetic JWS, mcp.clickup.com/oauth/authorize fixed_credential_raw accepted accepted
aa.<AKIA…>.bb, clickup fixed_credential_raw accepted (leak) fixed_credential_raw
aa.<AKIA…>.bb, mcp.linear.app/authorize fixed_credential_raw accepted (leak) fixed_credential_raw
ghp_<36>.a.b, gitlab.com/oauth/authorize fixed_credential_raw accepted (leak) fixed_credential_raw

_OAUTH_JWS_CLIENT_ID_RE matches any three base64url segments. _blank_jws_client_id then blanks the whole value at all three scan sites, at every approved endpoint, including operator-added oauth_endpoints.json entries.

#16816 closes these cases but has its own open security blocks; see its maintainer handoff. Please continue there. If #16816 is abandoned, this PR can be reopened, but it would need the narrowing above and a rebase first.

@bolichen97 bolichen97 closed this Oct 6, 2026
@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Oct 6, 2026
@dwu96 dwu96 removed the drive-to-green PR claimed by drive-to-green pipeline label Oct 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor) merge conflict Branch has merge conflicts with its base — author must resolve before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants