You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OIDC rejects every valid token: decodeJWT returns crow::json::rvalue pointing into freed strings #273
Impact: with auth.type: oidc (REST, and MCP, which uses the same handler), every token gets 401 in v26.11.25, including correct ones. OIDC authentication does not work.
Cause:OIDCAuthHandler::decodeJWT (src/oidc_auth_handler.cpp around 255-285) base64-decodes the header and payload into the local strings header_json and payload_json, parses them with crow::json::load, and returns std::make_pair(header, payload). A crow::json::rvalue refers into the buffer it was parsed from, which is freed when the function returns. The later header.has("alg") / has("kid") calls read freed memory. The log shows OIDC error: JWT header missing 'alg' field (or 'kid' when kid is the first key).
Repro (found while writing the authentication guide, #272):
Run a mock issuer on 127.0.0.1 that serves discovery and JWKS.
Send an RS256 token with the header {"alg":"RS256","typ":"JWT","kid":"k1"} and valid claims.
The response is 401. There is no end-to-end OIDC success test in the suite, which is why this went unnoticed.
Fix direction: keep the JSON text alive alongside the parsed values (return the strings together with the rvalues, or parse into an owning crow::json::wvalue / use jwt-cpp's decoded claims). Add an integration test against a mock IdP that accepts a valid token and rejects bad signature, issuer, audience and expiry.
Related findings from the same review:
A dotted roles-claim always means nesting, so Auth0-style namespaced claims (https://app.example.com/roles) can't resolve.
An explicit username-claim: sub is overridden by the presets.
groups-claim, scopes, client-secret, enable-client-credentials and enable-refresh-tokens are parsed but have no effect.
Without allowed-audiences, client-id is not checked against aud.
Activity
docs: Rework the authentication and authorization guide (#272)
docs: Restore the OIDC known-issue box in the authentication guide (#273
docs: Task guides for every feature area, run in CI (#272) (#274)
test: Add an end-to-end OIDC test against a mock issuer (#273)
fix: OIDC accepts valid tokens again (#273)
docs: OIDC works again after #273; drop the known-issue box
fix: OIDC accepts valid tokens again (#273) (#283)
chore: Release v26.11.26 (#285)