Repository navigation
fix(client): security hardening - #709
Conversation
Follow-up hardening in request building and the HTTP transport. Reported internally.
🟡 Risk Classification: MINORApproval route: AI Review + Human Approval Classification reasons
Operational gates
Files analysed: 4 wall-e 2026.06.19-02 · policy |
🔬 Debug — why this classification?Each reason code emitted by the classifier, its source clause in the AI in SDLC Control Framework, and what it means.
Kinds:
See issue #3 for the proposal to formalise this map as Appendix A of the standards doc. wall-e 2026.06.19-02 · debug |
🟠 Advisory review: Concerns worth a lookThis PR needs a human approval. Before you give it, these are the things I'd want resolved. This PR adds input validation for path parameters, base URIs, and the HTTP transport — the logic reads as correct and the test coverage is extensive, but several concrete issues need resolution before approval. Concerns
This is not an approval. wall-e cannot auto-approve this PR — it is an opinion to help whoever does. Advisory review · us.anthropic.claude-sonnet-4-6 · wall-e 2026.06.19-02 |
🟡 Risk Classification: MINORApproval route: AI Review + Human Approval Classification reasons
Operational gates
Files analysed: 4 wall-e 2026.06.19-02 · policy |
🔬 Debug — why this classification?Each reason code emitted by the classifier, its source clause in the AI in SDLC Control Framework, and what it means.
Kinds:
See issue #3 for the proposal to formalise this map as Appendix A of the standards doc. wall-e 2026.06.19-02 · debug |
🟡 Risk Classification: MINORApproval route: AI Review + Human Approval Classification reasons
Operational gates
Files analysed: 4 wall-e 2026.06.19-02 · policy |
🔬 Debug — why this classification?Each reason code emitted by the classifier, its source clause in the AI in SDLC Control Framework, and what it means.
Kinds:
See issue #3 for the proposal to formalise this map as Appendix A of the standards doc. wall-e 2026.06.19-02 · debug |
Input validation for request paths and base URIs.
- Path parameters that cannot be sent as exactly one path segment are
refused with a CheckoutArgumentException before any request is sent.
- The transport checks the final request path and query, and validates
each base URI when the SDK is built; the error names the setting
(for example filesApi), never its value. The environment subdomain
is added after the same validation, without decoding the URI.
- Path and query character rules live in one shared helper.
- CustomersClient documents which identifiers GET /customers/{identifier}
accepts; the README lists every base URI setting and its format.
Valid identifiers are sent exactly as before.
🟡 Risk Classification: MINORApproval route: AI Review + Human Approval Classification reasons
Operational gates
Files analysed: 16 wall-e 2026.06.19-02 · policy |
🔬 Debug — why this classification?Each reason code emitted by the classifier, its source clause in the AI in SDLC Control Framework, and what it means.
Kinds:
See issue #3 for the proposal to formalise this map as Appendix A of the standards doc. wall-e 2026.06.19-02 · debug |
- Base URIs are refused when their host is not ASCII. - README Custom Environment: which settings the base URI rules cover, the OAuth token URI, and that a query or fragment is not sent. - Javadoc of the environment subdomain describes the normalised URI.
🟡 Risk Classification: MINORApproval route: AI Review + Human Approval Classification reasons
Operational gates
Files analysed: 16 wall-e 2026.06.19-02 · policy |
🔬 Debug — why this classification?Each reason code emitted by the classifier, its source clause in the AI in SDLC Control Framework, and what it means.
Kinds:
See issue #3 for the proposal to formalise this map as Appendix A of the standards doc. wall-e 2026.06.19-02 · debug |
🟡 Risk Classification: MINORApproval route: AI Review + Human Approval Classification reasons
Operational gates
Files analysed: 16 wall-e 2026.06.19-02 · policy |
🔬 Debug — why this classification?Each reason code emitted by the classifier, its source clause in the AI in SDLC Control Framework, and what it means.
Kinds:
See issue #3 for the proposal to formalise this map as Appendix A of the standards doc. wall-e 2026.06.19-02 · debug |
|
This release brings security hardening of request building, the OAuth client and request logging, and fixes responses that repeat a header. Custom base URIs and the OAuth authorization URI are now validated when the SDK is built, so check them before upgrading if you set them. No public member is removed; one constructor is added. **Added** * `CheckoutAuthorizationException(String, Throwable)` (#711). **Changed** * Security hardening (#707, #709, #711). * Path values that cannot be sent as one path segment (null, empty, `.`, `..`, or containing "/" or "\") raise `CheckoutArgumentException` before the request is sent. For `CustomersClient#get` with an email that contains "/" or "\", pass the customer ID instead (#707, #709). * Custom base URIs (`CustomEnvironment`, or a custom `UriStrategy` given to `ApiClientImpl`) are validated when the SDK is built, every setting included. An invalid one fails `build()` with a `CheckoutArgumentException` that names the setting. Use absolute `http` or `https` URIs with a host, ending with "/" when they have a path, as described in the README Custom Environment section (#709). * The OAuth authorization URI must be an absolute `https` URI with an ASCII host written without percent-encoding, no user information and an optional port from 1 to 65535; `http` is accepted only for `localhost`, `127.0.0.0/8` and `[::1]`. Any other URI throws `CheckoutArgumentException` when the SDK is built (#711). * OAuth token request failures and token responses that cannot be used raise `CheckoutAuthorizationException`, a subclass of `CheckoutException`. Catch `CheckoutException` or `CheckoutAuthorizationException` (#711). * The request and response log lines hold less information (#711). **Fixed** * A response that repeats a header (for example two `Set-Cookie` headers) is no longer reported as a 400; the first value is kept (#713). * With a custom base URI that has a path, iDEAL requests stay under that path like every other request (#707).



Summary
Security hardening of request building and the HTTP transport: input validation for path parameters, the final request URL and the configured base URIs.
Changes
AbstractClient: path parameters that cannot be sent as exactly one segment are refused with aCheckoutArgumentExceptionbefore any request is sent.ApacheHttpClientTransport: input validation of the final request path and query; each base URI goes throughBaseUriwhen the client is created.BaseUri(new, package-private): base URI validation and the environment subdomain rebuild, one place for both; errors name the setting, never its value.EnvironmentSubdomain:checkoutApiis validated with the same rules before the subdomain is added; the rebuilt URIs keep the path, query and fragment without decoding (checkoutApiafter normalising) and host names with "_" keep working.ApiClientImpl,CheckoutApiImpl,AbstractCheckoutApmApi: pass the name of the base URI setting (checkoutApi,filesApi,transfersApi,balancesApi,forwardApi,identityApi) to the transport for its errors.UriCharacters(new, package-private): one helper for the path and query character rules, used byAbstractClient, the transport andBaseUri.CustomersClient: Javadoc on every method;getandgetSyncdocument which identifiers are accepted.README.md: the Custom Environment section lists every URI setting, says each one is needed when the SDK is built and how a base URI with a path must end. The base URI rules apply to the six API settings;oAuthAuthorizationApikeeps its current handling (only its host is checked withenvironmentSubdomain).CheckoutSdkBaseUriTest(new, public builder with a recording HTTP client),UriCharactersTest(new),ApacheHttpClientTransportRequestUrlTestandAbstractClientBuildPathTestextended,RecordingHttpClientBuilder(new test helper).API Reference
GET /customers/{identifier}: https://api-reference.checkout.com/tag/customers/GET/customers/%7Bidentifier%7DBreaking changes
CheckoutArgumentExceptionbefore the request is sent.CustomersClient.get/getSyncwith an email containing "/" or "": pass the customer's ID instead.CustomEnvironment, or a customUriStrategygiven toApiClientImpl) are validated when the SDK is built, every setting included, also ones never called. An invalid one now failsbuild()with aCheckoutArgumentExceptionthat names the setting. WithenvironmentSubdomain,checkoutApigets the same validation and its host, like the host ofoAuthAuthorizationApi, must be a domain name. Migration: give each setting an absolutehttporhttpsURI with a host, as described in the README Custom Environment section, ending with "/" when it has a path.Both are minor (security hardening). Built-in environments and valid identifiers are unchanged on the wire.
Tests
Related
None.