Repository navigation
fix(client): security hardening - #479
Conversation
Input validation for request building. Values placed in request paths are percent-encoded per segment, and undefined, empty, "." and ".." path values throw ValueError before any request is sent. Query strings are built with the shared buildQueryParams helper, so their values are percent-encoded too. Values without special characters, such as resource ids, go out unchanged.
🔴 Risk Classification: MAJORApproval route: AI Review + Human Approval Required Classification reasons
Operational gates
Files analysed: 69 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: Sound, but needs your judgementThis PR needs a human approval. The code itself reads as correct; whether it should land depends on context I don't have. This PR adds For you to decide
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: MAJORApproval route: AI Review + Human Approval Required Classification reasons
Operational gates
Files analysed: 69 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 |
|



Summary
Security hardening: input validation and encoding when building request URLs. Path values are percent-encoded per segment and query strings are built with the shared
buildQueryParamshelper. Reported internally.Changes
src/services/utils.js: newencodePathSegmenthelper, next tobuildQueryParams.src/api/balances/balances.js,src/api/disputes/disputes.js,src/api/events/events.js,src/api/financial/financial.js,src/api/payment-methods/payment-methods.js,src/api/payments/payments.js,src/api/platforms/payment-instruments.js,src/api/reconciliation/reconciliation.js,src/api/reports/reports.js: path values encoded withencodePathSegment; query strings built withbuildQueryParams;@throwsadded to the JSDoc.src/api/apm-specific/baloto.js,src/api/apm-specific/boleto.js,src/api/apm-specific/fawry.js,src/api/apm-specific/klarna.js,src/api/apm-specific/oxxo.js,src/api/apm-specific/pagofacil.js,src/api/apm-specific/rapipago.js,src/api/apm-specific/sepa.js,src/api/compliance-requests/compliance-requests.js,src/api/customers/customers.js,src/api/files/files.js,src/api/forward/forward.js,src/api/google-pay/google-pay.js,src/api/hosted-payments/hosted-payments.js,src/api/identities/address-document-verifications.js,src/api/identities/aml-screenings.js,src/api/identities/applicants.js,src/api/identities/face-authentications.js,src/api/identities/id-document-verifications.js,src/api/identities/identity-verifications.js,src/api/instruments/instruments.js,src/api/inventory/inventory.js,src/api/issuing/cardholders.js,src/api/issuing/cards.js,src/api/issuing/control-groups.js,src/api/issuing/control-profiles.js,src/api/issuing/controls.js,src/api/issuing/digital-cards.js,src/api/issuing/disputes.js,src/api/issuing/simulate.js,src/api/issuing/transactions.js,src/api/network-tokens/network-tokens.js,src/api/onboarding-simulator/onboarding-simulator.js,src/api/payment-contexts/payment-contexts.js,src/api/payment-sessions/payment-sessions.js,src/api/payment-setups/payment-setups.js,src/api/payments-links/payments-links.js,src/api/platforms/entity-requirements.js,src/api/platforms/files.js,src/api/platforms/payout-schedules.js,src/api/platforms/reserve-rules.js,src/api/platforms/subentity.js,src/api/sessions/sessions.js,src/api/tokens/tokens.js,src/api/transfers/transfers.js,src/api/webhooks/webhooks.js,src/api/workflows/workflows.js: path values encoded withencodePathSegment;@throwsadded to the JSDoc.test/services/utils.js: tests forencodePathSegment.test/services/path-segments-unit.js: one parametrised suite over every method that puts a caller value in the request path (exact path for a valid id, encoded values, rejected values).test/balances/balances-balances-at-unit.js,test/balances/balances-unit.js,test/disputes/disputes-unit.js,test/events/events.js,test/financial/financial.js,test/payment-methods/payment-methods-unit.js,test/payments/getPaymentList.js,test/platforms/payment-instruments/payment-instruments-unit.js,test/reconciliation/reconciliation-unit.js,test/reports/reports-unit.js: query encoding tests for each method that builds a query string; the balances assertion now expects the encoded colon.API Reference
None. No request or response schema changes.
Breaking changes
Path and query values are now percent-encoded by the SDK. Callers that already encoded a value themselves (for example with
encodeURIComponent) should pass the raw value instead, otherwise it is encoded twice and the API will not find it. Values without special characters, such aspay_,ent_orcus_ids, go out unchanged. Undefined, null, empty,.and..path values now throwValueErrorbefore any request is sent (the API answered 404 for them).Released as a minor; reviewers, please flag it if you think this needs a major.
Tests
Related
None.