-
-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Description
Problem
_get_client_ip() in autobot-slm-backend/api/auth.py (line 30-35) blindly trusts the X-Forwarded-For header:
forwarded_for = http_request.headers.get("X-Forwarded-For")
if forwarded_for:
return forwarded_for.split(",")[0].strip()An attacker can spoof their IP in audit logs by sending X-Forwarded-For: 10.0.0.1. Since this is the canonical auth endpoint after #1922, all login audit trails are affected.
Location
autobot-slm-backend/api/auth.py, lines 30-35
Proposed Fix
- Validate
X-Forwarded-Foragainst a trusted proxy list from SSOT config - Or configure FastAPI's
TrustedHostMiddleware - At minimum, only trust the header when the direct client IP matches a known reverse proxy
Impact
High — audit log IP addresses can be spoofed, undermining forensic value of login audit trail.
Discovered During
Reactions are currently unavailable