binance / binance/binance-futures-connector-python
[Security] Signature Appended to URL Query String in Cleartext and Logged
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 326
- PR merge metrics
- No merged PRs in 30d
Description
## Bug Name
Signature Appended to URL Query String in Cleartext and Logged
## Attack Scenario
limited_encoded_sign_request() appends the HMAC signature directly into the URL path as a query parameter. The URL with signature is then logged at DEBUG level on line 107. Response bodies with account data are also logged.
## Impact
Signed request URLs in logs enable replay attacks within the recvWindow period. Combined with response logging, complete request-response pairs containing account data are exposed.
## Components
File: /binance/api.py, lines 85-101 (limited_encoded_sign_request), line 107 (logging.debug('url: ' + url)), line 117 (response logging).
## Reproduction
1. Enable DEBUG logging.
2. Make any authenticated request.
3. Full URL with signature parameter visible in logs.
4. Full response body with account balances also logged.
## Fix
Redact or truncate signatures in log output. Never log full response bodies for authenticated endpoints. Consider a custom log filter that strips signature= parameters.
## Details
Finding ID: M-01
Severity: Medium
---
Researcher: Independent Security Researcher -- Mefai Security Team
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.