Skip to content

fix(client): security hardening - #707

Merged
armando-rodriguez-cko merged 4 commits into
masterfrom
fix/INT-1777-security-hardening
Nov 11, 2026
Merged

armando-rodriguez-cko merged 4 commits into
masterfrom
fix/INT-1777-security-hardening

Conversation

@armando-rodriguez-cko

@armando-rodriguez-cko armando-rodriguez-cko commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Security hardening and input validation in request building.

Changes

  • src/main/java/com/checkout/AbstractClient.java: buildPath percent-encodes each path parameter as one segment; input validation of path parameters (null, empty, ., .. or invalid text raise CheckoutArgumentException).
  • src/main/java/com/checkout/ApacheHttpClientTransport.java: input validation of the request path and its query, and the resolved URL must stay under the configured base URI. A base URI without a path resolves under its root.
  • src/main/java/com/checkout/events/previous/EventsClientImpl.java: the event types version is encoded.
  • SepaClientImpl, BacsClientImpl, IssuingClientImpl, IdealClientImpl, InstrumentsClientImpl, PaymentSetupsClientImpl: refactoring, fixed path prefixes passed one segment at a time.
  • EventTypesQuery.cs (new, internal): the event types version is now sent as a query filter
    through ApiClient.Query, like the other query filters, instead of being appended to the path
    by hand. ?version=1.0 is unchanged on the wire.
  • ApiClient.cs (LoggablePath): the request log line keeps the HTTP method and path, but leaves out the query string and masks path segments that hold an email address.

Tests

  • ./gradlew build: all unit and integration tests pass.
  • New tests encode path segments, refuse invalid path parameters and request paths on every HTTP operation and on file uploads, and keep the request URLs of the refactored clients.
  • Tests: new AbstractClientBuildPathTest and ApacheHttpClientTransportRequestUrlTest (every HTTP operation, sync and async, and file uploads); new cases in EventsClientImplTest and IdealClientImplTest.
  • ApiClientLoggingTest.cs (new): the logged path has no query string and no email address, checked on the helper and on a real ApiClient request.

Related

None.

API Reference

None.

Breaking changes

None. No public or protected signature changes, and the ApiClient calls made by every client are the same as before. Path parameters that are null, empty, ., .. or not valid text now raise CheckoutArgumentException instead of sending a request. Request URLs are unchanged for the built-in environments; with a custom base URI that has a path, iDEAL requests now stay under that path like every other request.

Security hardening and input validation in request path building.
Fixed path prefixes are passed one segment at a time; request URLs
are unchanged.
@armando-rodriguez-cko
armando-rodriguez-cko requested a review from a team November 9, 2026 13:18
@agent-wall-e

agent-wall-e Bot commented Nov 9, 2026

Copy link
Copy Markdown

🟡 Risk Classification: MINOR

Approval route: AI Review + Human Approval
Rollback controls: Staged rollout + rollback

Classification reasons

  • no_low_class_matched
  • prod_source_modified

Operational gates

  • ✅ jira_ticket (INT-1777)
  • ✅ independent_review

Files analysed: 13


wall-e 2026.06.19-02 · policy 6b4ce2b3b45a…

@agent-wall-e

agent-wall-e Bot commented Nov 9, 2026

Copy link
Copy Markdown
🔬 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.

Reason code Kind Clause Meaning
no_low_class_matched informational §2.2 (fall-through) None of the deterministic Low classes (§2.2.3, §2.2.4, §2.2.7, docs-only) applied; classifier fell through to LLM evaluation.
prod_source_modified informational §2.1 M7 (informational) At least one file is non-doc, non-test, non-IaC — i.e. application source code was modified.

Kinds:

  • classifying — this rule contributed to the chosen tier.
  • informational — context only; did not by itself decide the tier.

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 of the request path on every HTTP operation; the
resolved URL must stay under the base URI. Query parameters are always
sent apart from the path, with new Type overloads for query.
The Type overloads of query are default methods. A base URI without a
path resolves request paths under its root.
The event types version is sent as an encoded query on the same call
as before, so no ApiClient overloads are added. The transport accepts
only an already encoded query after the path.
@agent-wall-e

agent-wall-e Bot commented Nov 10, 2026

Copy link
Copy Markdown

🟡 Risk Classification: MINOR

Approval route: AI Review + Human Approval
Rollback controls: Staged rollout + rollback

Classification reasons

  • no_low_class_matched
  • prod_source_modified

Operational gates

  • ✅ jira_ticket (INT-1777)
  • ✅ independent_review

Files analysed: 13


wall-e 2026.06.19-02 · policy 6b4ce2b3b45a…

@agent-wall-e

agent-wall-e Bot commented Nov 10, 2026

Copy link
Copy Markdown
🔬 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.

Reason code Kind Clause Meaning
no_low_class_matched informational §2.2 (fall-through) None of the deterministic Low classes (§2.2.3, §2.2.4, §2.2.7, docs-only) applied; classifier fell through to LLM evaluation.
prod_source_modified informational §2.1 M7 (informational) At least one file is non-doc, non-test, non-IaC — i.e. application source code was modified.

Kinds:

  • classifying — this rule contributed to the chosen tier.
  • informational — context only; did not by itself decide the tier.

See issue #3 for the proposal to formalise this map as Appendix A of the standards doc.

wall-e 2026.06.19-02 · debug

@sonarqubecloud

Copy link
Copy Markdown

@armando-rodriguez-cko
armando-rodriguez-cko merged commit d75ebe3 into master Nov 11, 2026
6 checks passed
@armando-rodriguez-cko
armando-rodriguez-cko deleted the fix/INT-1777-security-hardening branch November 11, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants