fix(csp): allow Stripe-hosted destinations in bunyip-web form-action (BUNYIP-235) #264
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/BUNYIP-235-bunyip-web-csp-stripe-form-action"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The membership Subscribe button posts to /membership/subscribe, which 302s to https://checkout.stripe.com/... to start a Checkout session. Per CSP3 the form-action directive applies to the entire request chain including the server-side redirect target, so bunyip-web's CSP
form-action 'self'silently dropped every Subscribe click and the user saw the page just refresh.bunyip-web has its OWN CSP at bunyip-web/src/security.rs (BUNYIP-232) - distinct from the dunite-core one that wraps bunyip-api responses. The earlier dunite-core fix on this ticket only addresses bunyip-api-served responses; this PR completes the fix for the bunyip-web pages the user actually loads. Same change pattern: extend form-action to
'self' https://checkout.stripe.com https://billing.stripe.com, mirroring the frame-src style of stripe-hosted-host allowlisting already used elsewhere in the security space.New unit test pins the substring so a future tightening surfaces in CI before it ships and breaks every Subscribe button.
After deploy the cancel-then-subscribe flow works end-to-end: cancel trial, click Subscribe, lands on Stripe Checkout on first click.
#BUNYIP-235