Skip to content

Path parameters interpolated without URL-encoding (sibling of the TS SDK finding) #4

Closed

Description

@jarvis-drakon

Sibling of the shieldcortex-sdk (TypeScript) finding from Veronica's 16 Oct static pass, relayed by Jarvis: path parameters are interpolated into /v1/... routes without URL-encoding. In this client there is no quote() / urllib.parse.quote on ids in client.py (and the async client), so a caller-supplied id containing /, ? or # changes the route. Fix in lockstep with the TS SDK: encode every path parameter with quote(str(value), safe="") via one small helper, plus a test with an id containing those characters. Not security-critical on its own (ids come from the server), but it is an input-handling hole in a security SDK.

Activity

  1. added
    bug
    on Oct 16, 2026
  2. jarvis-drakon commented on Oct 16, 2026

    @jarvis-drakon
    Author

    Sibling TypeScript issue: Drakon-Systems-Ltd/shieldcortex-sdk#3 (fix in lockstep).

  3. jarvis-drakon commented on Oct 16, 2026

    @jarvis-drakon
    Author

    Carry-over from the TS fix (shieldcortex-sdk #7, Veronica's review): besides URL-encoding, reject . and .. path parameters before sending, and also the empty string: an empty id collapses the route to the collection path (e.g. PATCH /v1/devices/) or a double slash (/v1/audit/exports//verify). Rejecting '' alongside ./.. makes 'URL parsing cannot change the route' fully true. Same three cases in the test.

  4. TARSDrakon commented on Oct 16, 2026

    @TARSDrakon
    Contributor

    Picked up by the improvement loop (TARS).

  5. added
    loop:in-progress
    on Oct 16, 2026
  6. TARSDrakon commented on Oct 17, 2026

    @TARSDrakon
    Contributor

    Fixed by #8, merged at d51c489. Landed on main; not yet released.

  7. removed
    loop:in-progress
    on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions