Repository navigation
fix(client): security hardening - #711
Conversation
🔴 Risk Classification: MAJORApproval route: AI Review + Human Approval Required Classification reasons
Operational gates
Files analysed: 8 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 comment has been minimized.
This comment has been minimized.
869e0eb to
e699410
Compare
🔴 Risk Classification: MAJORApproval route: AI Review + Human Approval Required Classification reasons
Operational gates
Files analysed: 8 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 |
e699410 to
b5a30f4
Compare
🔴 Risk Classification: MAJORApproval route: AI Review + Human Approval Required Classification reasons
Operational gates
Files analysed: 11 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 |
|
Thanks. Each point was checked against the branch; the valid ones are addressed in b5a30f4, the others need no change. |
🔴 Risk Classification: MAJORApproval route: AI Review + Human Approval Required Classification reasons
Operational gates
Files analysed: 11 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 |
Security hardening and input validation in the OAuth client and in request logging.
d532c12 to
32b5ae9
Compare
🔴 Risk Classification: MAJORApproval route: AI Review + Human Approval Required Classification reasons
Operational gates
Files analysed: 11 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 the OAuth client and of request logging: input validation of the
authorization URI and of the token response, and improved error handling of the token request.
Changes
src/main/java/com/checkout/OAuthSdkCredentials.java: security hardening of the token request and input validationof the authorization URI and of the token response; improved error handling: token request failures raise
CheckoutAuthorizationException.src/main/java/com/checkout/BaseUri.java: input validation of the authorization URI on the subdomain; authorityhelpers shared with the authorization URI validation.
src/main/java/com/checkout/EnvironmentSubdomain.java: documentation of the subdomain URIs.src/main/java/com/checkout/CheckoutAuthorizationException.java: new constructorCheckoutAuthorizationException(String, Throwable); class and members documented.src/main/java/com/checkout/ApacheHttpClientTransport.java: security hardening of request logging.README.md: "Custom Environment" says which authorization URIs are accepted.Design notes: the response headers written to the log come from a fixed allowlist (
Cko-Request-Id,Cko-Version,Content-Type,Content-Length,Date), so a header the SDK does not know is never logged; an allowlist is keptinstead of a blocklist because new headers are then left out by default. The authorization URI check reuses the
authority helpers of
BaseUri(visible ASCII, host and port), so the URI with a subdomain and the URI without onefollow the same rules in one place.
expires_inmust be present and positive, and an expiration date that cannot becomputed is an invalid response; there is no upper limit, so any lifetime the token endpoint returns is kept.
API Reference
None.
Breaking changes
None in the public API (one constructor added). Behaviour changes, released as a minor version:
httpsURI with an ASCII host written without percent-encoding, nouser information and an optional port from 1 to 65535;
httpis accepted only forlocalhost,127.0.0.0/8and[::1]. Any other URI throwsCheckoutArgumentExceptionwhen the SDK is built. Migration: use thehttpsURI ofthe token endpoint, or a loopback host for a local mock server. Why it cannot stay compatible: the client
credentials are sent to this URI, so this rule is the fix itself.
CheckoutAuthorizationException, among them three thatwere accepted before: a status other than 200 with a token in the body, an empty
access_tokenand anexpires_inthat is not positive. Migration: none for the Checkout.com token endpoints. Why it cannot stay compatible: the token
request fails closed on a response it cannot trust; the others carry no usable token and failed later with a less
specific error.
CheckoutAuthorizationException, a subclass ofCheckoutException, also where alibrary or JDK exception was raised before (
JsonSyntaxException,IllegalArgumentException,org.apache.http.ParseException,NullPointerException,DateTimeException,ArithmeticException). Migration:catch
CheckoutExceptionorCheckoutAuthorizationException. Why it cannot stay compatible: one SDK type for everyinvalid token response.
these log lines. Why it cannot stay compatible: the information removed is what the fix keeps out of the logs.
Tests
Existing tests pass (
./gradlew build javadoc)Serialization tests cover every new or changed property (no request or response type changes)
README updated if documented usage changed
src/test/java/com/checkout/OAuthSdkCredentialsTokenRequestTest.java(new): authorization URIvalidation through the constructor,
CustomEnvironmentand the builder, and the token requestagainst local servers.
src/test/java/com/checkout/ApacheHttpClientTransportLoggingTest.java(new): request logging.src/test/java/com/checkout/OAuthSdkCredentialsTest.javaandsrc/test/java/com/checkout/CheckoutSdkBuilderTest.java:httpsURIs and the new messages.src/test/java/com/checkout/CheckoutSdkBaseUriTest.java: authorization URI validation on the subdomain.Related
None.