Skip to content

fix(auth): Hole 1 — bind agent sponsor to SSO-authenticated human, refuse workspace-key-set sponsors + hash-chained audit - #80

Draft
kjgbot wants to merge 1 commit into
mainfrom
agent/soc2-hole1-sso-sponsor-audit
Draft

fix(auth): Hole 1 — bind agent sponsor to SSO-authenticated human, refuse workspace-key-set sponsors + hash-chained audit#80
kjgbot wants to merge 1 commit into
mainfrom
agent/soc2-hole1-sso-sponsor-audit

Conversation

@kjgbot

@kjgbot kjgbot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • reject workspace-token callers that try to create a legacy/workspace-key-set sponsor identity
  • refuse attestation grants for identities without an OIDC-bound human sponsor
  • test both workspace-key sponsor forgery rejection paths
  • document the Chief → OIDC sponsor proof → RelayAuth binding mechanism
  • document the existing tamper-evident compliance ledger boundary

Root cause and impact

The sponsor API already verified an OIDC ID token and issued a short-lived RS256 sponsor proof, but legacy identity creation could still accept a sponsor selected by a workspace-key holder. Attestation issuance then trusted that legacy identity sponsorship. That allowed shared workspace-key holders to become indistinguishable in the evidence chain.

Identity creation now fails closed for workspace-token callers unless the organization requires OIDC sponsor binding and the caller supplies a valid RelayAuth sponsor proof. Attestation grant issuance independently requires the stored identity sponsor binding to be OIDC.

Audit Gap 3

The security evidence store already exists as attestation_ledger. It is append-only, has no update or retention deletion path, uses a per-organization SHA-256 prev_hash/entry_hash chain, and stores RS256-signed JWS entries. The separately retained audit_logs table remains the operational query feed and is explicitly not treated as the write-once evidence ledger. No redundant migration was added.

Validation

  • full RelayAuth server test suite: passed
  • focused attestation and OIDC sponsor-binding tests: 24 passed, 0 failed
  • git diff --check: passed

Known repository baseline

The monorepo build reaches an existing TypeScript package-boundary error because @relayauth/migrate does not emit a declaration file consumed by the server package. The server tests, including the new security coverage, pass.

@coderabbitai

coderabbitai Bot commented Aug 13, 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: 840e1b3f-3022-4779-87f8-88e0cbac240c

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

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.

❤️ Share

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