Skip to content

Commit 42ae271

Browse files
committed
🛡️ Sentinel: [MEDIUM] Fix log injection via HTTPStatusError (salvages #835)
Severity: MEDIUM Vulnerability: Unsanitized exception string from httpx.HTTPStatusError is embedded into a new exception message, potentially leaking sensitive URLs. Fix: Passed original_msg through sanitize_for_log() prior to raising httpx.HTTPStatusError, ensuring defense-in-depth against log leakage. Refs: #835 (salvage source)
1 parent d0a520b commit 42ae271

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎main.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1978,7 +1978,7 @@ def fetch_folder_data(url: str) -> FolderData:
19781978
# and reason phrase (e.g., "401 Unauthorized") in addition to our hint.
19791979
original_msg = str(e)
19801980
raise httpx.HTTPStatusError(
1981-
f"{original_msg} | hint: {hint} | url: {sanitize_for_log(url)}",
1981+
f"{sanitize_for_log(original_msg)} | hint: {hint} | url: {sanitize_for_log(url)}",
19821982
request=e.request,
19831983
response=e.response,
19841984
) from e

0 commit comments

Comments
 (0)