Repository navigation
fix(runtime_context): verify JWT signature in IASContextProvider - #424
Merged
Merged
Conversation
IASContextProvider was calling parse_token() — a deliberately unverified JWT decoder — and writing app_tid, sap_gtid, and user_uuid directly into the request-scoped RuntimeContext. This allowed an attacker to forge a JWT carrying any tenant/user identity and poison the runtime context consumed by RuntimeContextSpanProcessor, IdentityLogFilter, AuditClient, and CBCClient. Apply the same TokenVerifier / fail-closed pattern already used in StarletteIASTelemetryMiddleware: auto-configure an IASVerifier from the environment at construction time; return empty context when no binding is found or when verification fails. Security: fixes incomplete CWE-347 remediation from v0.62.0.
…ls in IASContextProvider IASTokenError (bad token) logged at DEBUG — expected, caller-side issue. Any other exception (DNS/TLS/JWKS unreachable) logged at WARNING — operator needs to know identity context is consistently broken. Addresses G6 review W3.
…section to user-guide
tiagoek
marked this pull request as ready for review
October 26, 2026 14:57
betinacosta
approved these changes
Oct 27, 2026
NicoleMGomes
approved these changes
Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
IASContextProvider.extract()was callingparse_token()— a deliberately unverified JWT decoder (verify_signature: False) — and writingapp_tid,sap_gtid,user_uuiddirectly into the request-scopedRuntimeContext. An attacker could submit a self-signed JWT with arbitrary tenant/user claims and poison the context consumed byRuntimeContextSpanProcessor,IdentityLogFilter,AuditClient, andCBCClient.Fix: apply the same
TokenVerifier/ fail-closed pattern used byStarletteIASTelemetryMiddleware— auto-configure anIASVerifierfrom the environment; return empty context when no binding is found or when verification fails.Related Issue
No GitHub issue tracked — this is a security fix for an internally reported finding.
Type of Change
How to Test
uv run pytest tests/core/unit/runtime_context/ -vtest_no_verifier_returns_empty_context— no IAS binding → empty context (fail-closed)test_forged_token_returns_empty_context— verifier raises → no claims leaktest_infra_error_logs_warning_not_debug— DNS/TLS failure logs at WARNING leveluv run pytest tests/ --ignore=tests/agent_memory --ignore=tests/destination/integration --ignore=tests/core/integration -qIASContextProvider()without an IAS binding starts without crashing and logs a WARNINGChecklist
/security-reviewand addressed all ❌ findings