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
Browse filesBrowse the repository at this point in the historyBrowse files
authored
fix: patch path traversal and missing HTTP timeouts (#1)
* fix: URL-encode path parameters to prevent path traversal
All service modules used str.replace() to interpolate user-supplied IDs
into URL path templates without URL encoding. The requests library
normalizes ../ sequences during URL preparation, so a crafted ID like
'../../admin/settings' could redirect requests to unintended API
endpoints with the merchant's API key attached.
Added _safe_path_param() in client_base.py using urllib.parse.quote()
with safe='' and updated all 40 path parameter interpolations across
17 service files to use it.
Co-authored-by: Babacar Diop <princemuichkine@users.noreply.github.com>
* fix: add configurable HTTP request timeout (default 30s)
The SDK's _request() method called session.request() without any timeout
parameter, causing all HTTP calls to block indefinitely if the API server
is slow or unresponsive. This could exhaust worker threads in consuming
applications and halt payment processing.
Added a configurable 'timeout' constructor parameter (default 30s) that
is passed to every requests.Session.request() call.
Co-authored-by: Babacar Diop <princemuichkine@users.noreply.github.com>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Babacar Diop <princemuichkine@users.noreply.github.com>
0 commit comments