Skip to content

Harden session/ingestion token separation and gate admin routes#25

Merged
cteyton merged 1 commit into
mainfrom
claude/verify-api-security-xcKgw
May 15, 2026
Merged

Harden session/ingestion token separation and gate admin routes#25
cteyton merged 1 commit into
mainfrom
claude/verify-api-security-xcKgw

Conversation

@cteyton

@cteyton cteyton commented May 15, 2026

Copy link
Copy Markdown
Contributor

Session and ingestion JWTs were signed with the same secret and verified
by the same code path with no claim distinguishing them. An ingestion
token pasted into the session cookie passed signature verification and
the middleware set user with undefined fields, granting access to every
session-protected endpoint (including token minting and integration
secrets). Mirror-side: a session JWT presented as a Bearer token would
have been rejected only because session JWTs happen to lack a jti.

Adds a type claim ("session" or "ingestion") that each middleware now
enforces explicitly, validates that session JWTs carry non-empty
sub/email/role, and introduces a requireAdmin middleware applied to
credential-bearing and write routes (tokens, integrations,
marketplace-sources, audit, plus the write operations on skills,
marketplaces, and plugins). Read-only analytics endpoints remain open to
any authenticated session.

Session and ingestion JWTs were signed with the same secret and verified
by the same code path with no claim distinguishing them. An ingestion
token pasted into the `session` cookie passed signature verification and
the middleware set `user` with undefined fields, granting access to every
session-protected endpoint (including token minting and integration
secrets). Mirror-side: a session JWT presented as a Bearer token would
have been rejected only because session JWTs happen to lack a `jti`.

Adds a `type` claim ("session" or "ingestion") that each middleware now
enforces explicitly, validates that session JWTs carry non-empty
`sub/email/role`, and introduces a `requireAdmin` middleware applied to
credential-bearing and write routes (tokens, integrations,
marketplace-sources, audit, plus the write operations on skills,
marketplaces, and plugins). Read-only analytics endpoints remain open to
any authenticated session.
@cteyton cteyton merged commit 2c59e1d into main May 15, 2026
3 checks passed
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.

2 participants