You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
URL-encode record keys and request IDs to prevent path traversal #1005
The client interpolates record keys, request IDs, and resource IDs directly into request URLs. Values containing /, ?, #, or dot segments can therefore change the target path, query, or fragment.
For example, deleteRecord('..') resolves to the key-value store root and sends DELETE /v2/key-value-stores/{storeId}, potentially deleting the entire store. Other crafted values can target a different endpoint using the caller's token or silently access the wrong record.
Additionally, _toSafeId() uses id.replace('/', '~'), which replaces only the first slash.
Expected fix
Encode each dynamic path segment with encodeURIComponent() at its call site. Do not encode the complete path, because paths such as requests/batch contain intentional separators.
Reject '', . and ..; URL parsers resolve dot segments even when percent-encoded.
Keep record signatures based on the raw key, as the server verifies the decoded route parameter.
Make _toSafeId() replace every slash, matching the Python client.
changed the title [-]Record keys and request IDs are not URL-encoded, allowing path traversal[/-][+]URL-encode record keys and request IDs to prevent path traversal[/+]on Aug 21, 2026
Activity
[-]Record keys and request IDs are not URL-encoded, allowing path traversal[/-][+]URL-encode record keys and request IDs to prevent path traversal[/+]fix: prevent path traversal by sanitizing URLs (#1011)
vdusek commentedon Sep 4, 2026
resolved by #1011
fix: prevent path traversal by sanitizing URLs (#1011)
fix: prevent path traversal by sanitizing URLs (#1011)