Repository navigation
fix(functions-compiler): drop lang_version from Stripe's client user agent - #676
Draft
claude[bot] wants to merge 1 commit into
Draft
claude[bot] wants to merge 1 commit into
claude[bot] wants to merge 1 commit into
Conversation
…agent stripe-node before its workerd build sends workerd's fixed process.version (v22.19.0) as lang_version in X-Stripe-Client-User-Agent, and Stripe then warns customers about CVE-2026-111497. The shim's fetch wrapper now removes that one field from the header's JSON, before static-egress routing, and leaves the header alone when it does not parse. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DSAVJCkPcs1gz2QDpBQZQZ
Contributor
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.2.2-pr.676.83d8553Prefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.2.2-pr.676.83d8553"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.2.2-pr.676.83d8553"
}
}
Preview published to npm registry — try new features instantly! |
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.
Note
Description
stripe-node(v14 through v22.0.0) reportsprocess.versionaslang_versioninside the JSONX-Stripe-Client-User-Agentheader. In workerd that value is a fixed, stale Node version (v22.19.0), so Stripe reads it and emails app owners that their Node runtime is affected by CVE-2026-111497. This PR makes the functions-compiler shim strip only thelang_versionfield from that header on outbound requests, leaving every other field andprocess.versionitself untouched.Related Issue
None (reported via Slack — see attribution line on the original PR body)
Type of Change
Changes Made
stripStripeLangVersion()topackages/functions-compiler/src/static-egress.ts: parses theX-Stripe-Client-User-Agentheader as JSON and, when it is a plain object containinglang_version, re-serializes it without that key.createRequestScopedStaticEgressFetch()does, so it applies to all three routes (ordinary fetch, excluded hosts, and the dedicated static-egress binding) and to actors.lang_version, are passed through byte-for-byte with the originalinput/initidentity preserved.init.headersand headers carried on aRequestobject (the latter is rebuilt vianew Request(input, { headers })).test/static-egress.test.tscovering init headers,Requestheaders, pass-through cases (non-JSON, already-stripped object, JSON array), and the dedicated-egress route.test/stripe-user-agent.e2e.test.tsthat bundlesnpm:stripe@20.4.1, runs it in workerd against a local echo server, and asserts the received user-agent header has nolang_versionwhile retainingbindings_version,lang, andplatform.Testing
Checklist
Additional Notes
🤖 Generated by Claude | 2026-10-23 15:02 UTC | 83d8553