🇰🇷 한글 설명
hackney 라이브러리의 자격증명 보호 미흡 취약점입니다. follow_redirect 활성화 시 같은 호스트 내에서 https에서 http로, 또는 다른 포트로의 리다이렉트가 발생하면 Authorization 및 Cookie 헤더가 보호되지 않은 채 전달됩니다. 이로 인해 공격자가 기본 인증 정보와 쿠키를 탈취할 수 있습니다.
💡 쉬운 설명
Erlang HTTP 클라이언트 라이브러리가 리다이렉트 시 로그인 정보를 안전하지 않은 주소나 다른 서비스로 그대로 보냅니다. 네트워크를 엿보는 공격자가 이 정보를 가로챌 수 있습니다.
🇺🇸 원문 (English)
Insufficiently Protected Credentials vulnerability in hackney in benoitc hackney allows a redirecting server to obtain the basic_auth and cookie credentials of a request via a same-host redirect to another scheme or port. With follow_redirect enabled, hackney:follow_redirect/10 in src/hackney.erl reissues the request to the Location target after hackney:maybe_strip_auth_on_redirect/3, which compared only the hostname of the current and the redirect URL. A redirect from https to http on the same host resent the Authorization and Cookie headers in cleartext, where an on-path attacker can read them, and a redirect to another port on the same host handed them to a different service. location_trusted forwards credentials to any target by design and is unchanged.
This issue affects hackney: from 2.0.0 before 4.9.0.
📍 영향받는 시스템
hackney 2.0.0 이상 4.9.0 미만을 사용하는 Erlang/Elixir 애플리케이션
⚔️ 공격 벡터
경로상 공격자(on-path) 또는 악의적 서버가 같은 호스트로의 리다이렉트를 유도해 인증 헤더와 쿠키를 탈취
🛡️ 대응 방법
hackney를 4.9.0 이상으로 업그레이드하고, 신뢰되지 않은 리다이렉트에 대해 follow_redirect 사용을 제한
🔧 검증 코드
출력된 hackney 버전이 4.9.0 미만이면 취약하며, 4.9.0 이상이면 패치가 적용된 것입니다.
grep -rE '"hackney"|hackney' rebar.lock mix.lock 2>/dev/null
💻 영향받는 소프트웨어
Windows iSCSI Target Service