Harden URL handling in exported telemetry - #1477
Merged
Merged
Conversation
Strip OAuth authorization codes and CSRF state from exported span URL attributes, and sanitize user-supplied MCP endpoints before stamping them.
Contributor
Cloudflare previewTorn down — the PR is closed. |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-cloud | b8c5d08 | Aug 28 2026, 09:01 PM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-marketing | b8c5d08 | Commit Preview URL Branch Preview URL |
Aug 28 2026, 09:00 PM |
@executor-js/cli
@executor-js/config
@executor-js/execution
@executor-js/sdk
@executor-js/codemode-core
@executor-js/runtime-quickjs
@executor-js/plugin-file-secrets
@executor-js/plugin-graphql
@executor-js/plugin-keychain
@executor-js/plugin-mcp
@executor-js/plugin-onepassword
@executor-js/plugin-openapi
executor
commit: |
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.
Change
Exported telemetry can carry request URLs verbatim. Query values, userinfo, and fragments are not safe in a trace store: OAuth callbacks receive
?code=…&state=…, query-auth API keys ride under arbitrary parameter names, and fragments carry implicit-grant tokens. Because parameter names are operator-chosen free text, no allowlist of safe names can exist — every query value is dropped, along with userinfo and fragments. Scheme, host, andurl.pathsurvive so traces stay debuggable.The redaction rules live in one shared module (
telemetry-url-redactionin@executor-js/sdk). Every exporter path consumes it:apps/cloud/src/observability/redact-span-urls.ts) wraps the export chain — the one point every isolate span passes through. It scrubs four channels: attributes, exception events, span links, and the status message. This is the only path that also carries diagnostics: the stripped parameter names (never values) are reported asurl.query.stripped_keys.UrlRedactingOtlpSerializationJson) scrubs the OTLP trace and log payloads as they serialize. Log records need it too: the OTLP logger exports pretty-printed failure causes and log annotations, both of which can embed raw URLs. Removal only — this seam adds no reporting metadata.url.full/url.queryKeyValue runs on top of the generic walk, never instead of it. Removal only.URLs also escape the attribute bag through error messages, so the scrub has a free-text form applied to every exported string.
Verification
format:check,lint,typecheck, and the scoped suites (sdk, cloud observability, host-selfhost, react) pass.Each redaction gap has a canary test that was proven red before its fix: a logged failure cause carrying a credential-bearing URL through the self-host export layer, a span link whose attributes carry secret URLs through the cloud processor, and a crafted KeyValue with URL-bearing sibling fields through the browser-traces path. All test data is synthetic.