retoor 5c3071ebf7 fix(realtime): parse upstream host as real IP before allow-list check (MOLO-EXPOSE-001)
UpstreamHostAllowed used bare string-prefix tests (host.rfind("10.",0)==0
etc.), so a public DNS name like "10.evil.com" or "127.evil.com" was
misclassified as private/loopback even though it resolves to an
attacker-controlled address (CWE-184). Now the host is parsed with
inet_pton (AF_INET and AF_INET6, including v4-mapped and fe80::/10) and
only a real IP literal is checked against numeric RFC1918/loopback/
link-local ranges; anything that fails to parse as a literal is never
treated as private. Also fixes the latent 172.16.0.0/12 check, which used
ad-hoc digit parsing instead of a real numeric subnet comparison.

audit/MOLO-EXPOSE-001 harness now prints PASS (7/7 cases correct).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-25 20:10:11 +01:00
S
Description
moloapp
5.2 MiB
Languages
C++ 90%
Python 3.2%
Pawn 3.2%
POV-Ray SDL 1.3%
JavaScript 1.1%
Other 1.1%