Skip to content

fix(sdk): reject updates on terminal checkout sessions - #16

Merged
blurrah merged 2 commits into
mainfrom
blurrah/fix-session-state-validation
Sep 1, 2026
Merged

fix(sdk): reject updates on terminal checkout sessions#16
blurrah merged 2 commits into
mainfrom
blurrah/fix-session-state-validation

Conversation

@blurrah

@blurrah blurrah commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Reject updates on terminal (completed/canceled) checkout sessions with a 400 invalid_state error, and bump to 0.0.0-alpha.10.

The update handler never consulted the FSM, so a completed (or
canceled) session could be rewritten by any caller: items, totals,
customer, and fulfillment all changed while the session kept
reporting completed, with no additional payment authorized or
captured.

Add an isTerminal() helper derived from the FSM transition table and
guard update after the session lookup, before products.price runs, so
terminal sessions cannot trigger merchant-side pricing. The rejected
request returns the same 400 invalid_state error shape cancel uses.

Fixes VULN-13971 (HackerOne #3948484, CWE-841).
@blurrah
blurrah merged commit e8a60e3 into main Sep 1, 2026
6 checks passed
@blurrah
blurrah deleted the blurrah/fix-session-state-validation branch September 1, 2026 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants