Skip to content

fix(oauth): reject control characters in access tokens - #52

Merged
riffingonsoftware merged 1 commit into
mainfrom
ricardo/reject-control-characters-in-access-tokens
Sep 23, 2026
Merged

riffingonsoftware merged 1 commit into
mainfrom
ricardo/reject-control-characters-in-access-tokens

Conversation

@riffingonsoftware

Copy link
Copy Markdown
Contributor

Was looking at some unrelated changes, I noticed that token responses containing control characters were accepted without an error. This change rejects those tokens in the response parser.

@riffingonsoftware

Copy link
Copy Markdown
Contributor Author

@riffingonsoftware
riffingonsoftware merged commit d669a63 into main Sep 23, 2026
7 checks passed
benburkert added a commit that referenced this pull request Oct 7, 2026
…pp id

The CLI renamed the token-issuance RPC from IssueJWT to IssueToken
(keycardai/cli#1246). Connect addresses a procedure by URL path, so the
old path answers 404 on any CLI that has the rename.

WithAgentAppID declares the Keycard application the caller acts for
(keycardai/cli#1255-#1257). It is sent as appId only when set, so a
server that predates the field sees the request it already understands.
IsApplicationNotFound and IsUnavailable read the two codes the server's
app id resolution adds, and IsDeclined and IsAuthorizationRequired now
document the wider set of causes those codes carry on the CLI's main
branch.

A token containing a control character is refused, matching the check
#52 added to token exchange: what the agent vends may be an opaque
third-party secret, and it is headed for an Authorization header.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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