Skip to content

fix(client): security hardening - #480

Merged
armando-rodriguez-cko merged 2 commits into
masterfrom
fix/INT-1827-security-hardening
Nov 18, 2026
Merged

armando-rodriguez-cko merged 2 commits into
masterfrom
fix/INT-1827-security-hardening

Conversation

@armando-rodriguez-cko

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

Copy link
Copy Markdown
Contributor

Summary

Security hardening: input validation of path parameters. Values that cannot be sent as a single path segment are rejected with a ValueError before any request is sent.

Changes

  • src/services/utils.js: input validation of path parameters in encodePathSegment, with a ValueError naming the parameter.
  • src/api/**: @throws documentation of every method that takes a path parameter updated to the accepted values; Customers.get documents the ID or email it takes.
  • test/services/utils.js, test/services/path-segments-unit.js: tests for the path helper and for every endpoint that takes a path parameter.
  • README.md: error handling section documents the accepted path parameter values.

API Reference

None.

Breaking changes

Path values that could not reach a valid endpoint now throw a ValueError instead of being sent (minor). For Customers.get, use the customer ID when the email contains a slash or a backslash.

Tests

  • Existing tests pass
  • Serialization tests cover every new or changed property (no request or response type changed)
  • README updated if documented usage changed

New tests fail on the default branch and pass on this branch; unit suite and the build workflow run locally are green.

Related

None.

Follow-up hardening of path parameters. Reported internally.
@armando-rodriguez-cko
armando-rodriguez-cko requested a review from a team November 13, 2026 13:00
@agent-wall-e

agent-wall-e Bot commented Nov 13, 2026

Copy link
Copy Markdown

🟢 Risk Classification: LOW

Approval route: AI Auto-Approval
Rollback controls: Automated Instant Rollback + feature flags

Classification reasons

  • no_low_class_matched
  • prod_source_modified
  • 2.2.6_logical_extension:This change only tightens input validation in an existing path-encoding helper by rejecting additional invalid characters before encoding, without changing the function signature, adding new endpoints, persisting data, or crossing any trust boundary.

Operational gates

  • ✅ jira_ticket (INT-1827)
  • ✅ independent_review

Files analysed: 3


wall-e 2026.06.19-02 · policy 6b4ce2b3b45a…

@agent-wall-e

agent-wall-e Bot commented Nov 13, 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.
2.2.6_logical_extension — This change only tightens input validation in an existing path-encoding helper by rejecting additional invalid characters before encoding, without changing the function signature, adding new endpoints, persisting data, or crossing any trust boundary. classifying §2.2.6 Sonnet 4.6 evaluator promoted minor → low: the change reuses existing code paths and does not cross a trust boundary.

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

@agent-wall-e agent-wall-e Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Auto-approved — this PR meets all Low-risk criteria.

All checks passed, no unresolved comments, and the change classification is:

  • no_low_class_matched
  • prod_source_modified
  • 2.2.6_logical_extension:This change only tightens input validation in an existing path-encoding helper by rejecting additional character classes before encoding, without modifying any endpoint, data model, auth logic, or external integration.

wall-e 2026.06.19-02 · policy 6b4ce2b3b45a…

Security hardening and input validation in request path building.
@agent-wall-e

agent-wall-e Bot commented Nov 17, 2026

Copy link
Copy Markdown

🔴 Risk Classification: MAJOR

Approval route: AI Review + Human Approval Required
Rollback controls: Change-freeze window + documented rollback plan

Classification reasons

  • security_sensitive_path:src/api/issuing/cardholders.js
  • security_sensitive_path:src/api/sessions/sessions.js
  • security_sensitive_path:src/api/tokens/tokens.js

Operational gates

  • ✅ jira_ticket (INT-1827)
  • ✅ independent_review

Files analysed: 58


wall-e 2026.06.19-02 · policy 6b4ce2b3b45a…

@agent-wall-e

agent-wall-e Bot commented Nov 17, 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
security_sensitive_path — src/api/issuing/cardholders.js classifying §2.1 M4/M5 Path matched a sensitive pattern (auth, secrets, crypto, PCI, migrations, network IaC).
security_sensitive_path — src/api/sessions/sessions.js classifying §2.1 M4/M5 Path matched a sensitive pattern (auth, secrets, crypto, PCI, migrations, network IaC).
security_sensitive_path — src/api/tokens/tokens.js classifying §2.1 M4/M5 Path matched a sensitive pattern (auth, secrets, crypto, PCI, migrations, network IaC).

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

@agent-wall-e

agent-wall-e Bot commented Nov 17, 2026

Copy link
Copy Markdown

🔵 Advisory review: Sound, but needs your judgement

This 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 path-parameter validation (rejecting /, \, ASCII control characters, and unpaired surrogates) across the entire SDK, with matching doc updates. The diff shown is entirely documentation/JSDoc changes — the actual validation logic in the path helper and all the calling code is in the 30+ omitted files, so correctness of the core implementation cannot be verified here.

For you to decide

  • The actual validation logic (the path helper and its callers) is in the omitted files; the reviewer must verify that the regex/check correctly covers exactly the stated set (U+0000–U+001F, U+007F, /, \, unpaired surrogates) and nothing more, since over-rejection would be a breaking change.
  • The README previously listed ValueError with HTTP status 429, which was clearly wrong; the fix to - is correct and should be verified against the actual error class definition in the omitted source.
  • The customers.js doc now explicitly warns that emails containing / or \ must use the customer ID instead — this is a known UX trade-off the product/API team should confirm is the intended guidance, since it changes how callers are expected to interact with the customer lookup endpoint.
  • All JSDoc @throws entries in the shown diff are internally consistent with each other and with the README addition, so the documentation layer itself looks correct.

⚠️ The diff was too large to read in full, so this review covers only part of the change.


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

@sonarqubecloud

Copy link
Copy Markdown

@armando-rodriguez-cko
armando-rodriguez-cko merged commit b7f281f into master Nov 18, 2026
6 of 7 checks passed
@armando-rodriguez-cko
armando-rodriguez-cko deleted the fix/INT-1827-security-hardening branch November 18, 2026 13:53
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