AdguardTeam / AdGuardHome

Network-wide ads & trackers blocking DNS server
https://adguard.com/adguard-home.html
GNU General Public License v3.0
25.38k stars 1.82k forks source link

Incorrect IP Logging for Failed Login Attempts and Potential Vulnerability to IP Spoofing #6978

Open zylxpl opened 6 months ago

zylxpl commented 6 months ago

Prerequisites

Platform (OS and CPU architecture)

Linux, ARM64

Installation

Docker

Setup

Other (please mention in the description)

AdGuard Home version

v0.107.48

Action

AHD behind rev proxy. On failed login attempts, the logs show the reverse proxy's IP address instead of the real user's IP address. Successful login attempts, however, are logged with the correct real user IP.

Expected result

If the reverse proxy is trusted, the logs should always display the real user IP address, retrieved for example from the XFF header.

Actual result

Failed login attempts are logged with the reverse proxy's IP address, which is not useful for auditing purposes. In contrast, successful login attempts are logged with the correct user IP address even for untrusted proxies - this might be vulnerable to IP spoofing attacks, where malicious actors could forge the X-Forwarded-For header to hide their identity.

Additional information and/or screenshots

image

PixelHir commented 2 months ago

Same issue over here, can successfully reproduce on a host networking container, with traefik as reverse proxy. (proxy is to https port, not http)

Safari 2024-08-31 at 00 49 35@2x IP not censored as its iCloud private relay anyways