Conversation
`ReferralCustomer.addCreditCard` built the `POST /v1/tokens` request with the card number, expiry and CVC in the URL query string. Stripe accepts the same form-encoded fields in the request body, which keeps cardholder data out of access logs, proxy logs, tracing tools and Referer headers. SEC-768 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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
ReferralCustomer.addCreditCardbuilds thePOST https://api.stripe.com/v1/tokensrequest withcard[number],card[exp_month],card[exp_year]andcard[cvc]in the URL query string, with an empty request body. Query strings are routinely captured by access logs, outbound proxies, APM/tracing tools andRefererheaders, so cardholder data could be retained outside the payment path (PCI DSS requirement 3 / 4).This change sends the same form-encoded fields in the request body instead. Stripe already expects
application/x-www-form-urlencodedbodies on this endpoint (it is whateasypost-ruby,easypost-goandeasypost-csharpdo today), so there is no behavioural change for callers.Also adds a
Next ReleaseCHANGELOG entry.Tracking: SEC-768 (internal).
Testing
npx eslint src/services/referral_customer_service.ts,npx prettier --check, and a fulltscpass all succeed locally.test/cassettes/ReferralCustomer-Service_*/add-a-referral-user-credit-card_*/recording.harwas recorded with the card fields in the URL, and Polly matches on URL and body, soadd a referral user credit cardwill not replay until it is re-recorded withPARTNER_USER_PROD_API_KEY/REFERRAL_CUSTOMER_PROD_API_KEY. I do not have those keys. When re-recording, please confirm the new recording no longer contains the test card PAN/CVC in the URL (the current HAR does) and that the body scrubber covers the form fields.Pull Request Type
Please select the option(s) that are relevant to this PR.
🤖 Generated with Claude Code