URL-encode query parameter values in APIClient._add_params #20

Closed
opened 2026-02-20 06:49:04 +00:00 by cal · 2 comments
Owner

Description

api/client.py:101_add_params builds query strings by simple string concatenation (f"{key}={value}"). Values are not passed through urllib.parse.quote. Path segments (object_id) are correctly encoded with quote(). If any query parameter value contains &, =, #, or spaces (e.g., a player name), the resulting URL will be malformed. Fix: use urllib.parse.urlencode(params).

File Locations

  • api/client.py:101

Labels

bug, security

Priority

high

## Description `api/client.py:101` — `_add_params` builds query strings by simple string concatenation (`f"{key}={value}"`). Values are not passed through `urllib.parse.quote`. Path segments (`object_id`) are correctly encoded with `quote()`. If any query parameter value contains `&`, `=`, `#`, or spaces (e.g., a player name), the resulting URL will be malformed. Fix: use `urllib.parse.urlencode(params)`. ## File Locations - `api/client.py:101` ## Labels bug, security ## Priority high
Author
Owner

Addressed in commit f4be20a on next-release branch. Will be closed when merged to main.

Addressed in commit f4be20a on `next-release` branch. Will be closed when merged to main.
Author
Owner

Addressed in commit f4be20a on next-release branch. Will be closed when merged to main.

Addressed in commit `f4be20a` on `next-release` branch. Will be closed when merged to main.
cal closed this issue 2026-02-20 20:29:06 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cal/major-domo-v2#20
No description provided.