Skip to content

Security: Fix SDK fail-open vulnerability and enforce closed authorization - #642

Open
mertcano wants to merge 6 commits into
sapiom:mainfrom
mertcano:mertcano-patch-1
Open

Security: Fix SDK fail-open vulnerability and enforce closed authorization#642
mertcano wants to merge 6 commits into
sapiom:mainfrom
mertcano:mertcano-patch-1

Conversation

@mertcano

@mertcano mertcano commented Aug 16, 2026

Copy link
Copy Markdown

This PR patches a HIGH-severity vulnerability in the SDK's transport/authentication layer where control-plane outages or authorization failures caused the SDK to default to an "open" failure mode (failureMode: "open"). This allowed unverified requests to bypass governance bounds and directly consume backend services. The default behavior is now strictly locked to "closed" and fail-open opt-ins are disabled for payment-protected endpoints.

Changes:

Secure Defaults: Changed the default failureMode in both @sapiom/fetch (createFetch) and @sapiom/node-http (createClient) adapters from "open" to "closed" to enforce secure defaults for all governed clients.

Payment-Protected Opt-Out Override: Updated interceptors.ts to calculate an effectiveFailureMode. If userMetadata?.paymentProtected is true, or if the flow has entered the handlePayment (HTTP 402) handler, the failure mode is forcibly set to "closed". This ensures it is impossible to explicitly opt-in to availability-first behavior for endpoints protected by a payment/budget boundary.

…ation

This PR patches a HIGH-severity vulnerability in the SDK's transport/authentication layer where control-plane outages or authorization failures caused the SDK to default to an "open" failure mode (failureMode: "open"). This allowed unverified requests to bypass governance bounds and directly consume backend services. The default behavior is now strictly locked to "closed" and fail-open opt-ins are disabled for payment-protected endpoints.

Changes:

Secure Defaults: Changed the default failureMode in both @sapiom/fetch (createFetch) and @sapiom/node-http (createClient) adapters from "open" to "closed" to enforce secure defaults for all governed clients.

Payment-Protected Opt-Out Override: Updated interceptors.ts to calculate an effectiveFailureMode. If userMetadata?.paymentProtected is true, or if the flow has entered the handlePayment (HTTP 402) handler, the failure mode is forcibly set to "closed". This ensures it is impossible to explicitly opt-in to availability-first behavior for endpoints protected by a payment/budget boundary.
@github-actions github-actions Bot added contribution: incomplete Required pull request information is incomplete or ambiguous contributor: external Pull request author does not have write, maintain, or admin access to sapiom-js needs-triage Awaiting maintainer review and classification review: manual External pull request requires maintainer review before automation size: xlarge Review size exceeds 1,000 changed lines area: integrations Changes to HTTP or framework integrations labels Aug 16, 2026
@mertcano mertcano changed the title Security: Fix SDK fail-open vulnerability and enforce closed authoriz… Security: Fix SDK fail-open vulnerability and enforce closed authorization Aug 16, 2026
@github-actions github-actions Bot added the area: sdk Changes to SDK core or analytics label Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: integrations Changes to HTTP or framework integrations area: sdk Changes to SDK core or analytics contribution: incomplete Required pull request information is incomplete or ambiguous contributor: external Pull request author does not have write, maintain, or admin access to sapiom-js needs-triage Awaiting maintainer review and classification review: manual External pull request requires maintainer review before automation size: xlarge Review size exceeds 1,000 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant