🇰🇷 한글 설명
Node.js용 URI 파서인 fast-uri에서 스킴(scheme) 구성 요소의 디코딩 처리 오류로 인해 발생하는 취약점입니다. 공격자가 인코딩된 슬래시를 포함한 스킴을 사용하면 파싱 결과와 실제 직렬화된 결과가 달라져, 허용 목록(allowlist)을 우회하거나 SSRF 및 오프사이트 리다이렉션을 유발할 수 있습니다.
💡 쉬운 설명
주소를 해석하는 프로그램이 특수하게 조작된 주소를 잘못 읽어서, 안전하다고 믿었던 주소가 실제로는 공격자가 원하는 위험한 주소로 바뀌어 접속될 수 있는 문제입니다. 이를 통해 웹사이트가 엉뚱한 곳으로 연결되거나 서버가 공격자의 명령을 수행하게 될 수 있습니다.
🇺🇸 원문 (English)
fast-uri is a URI parser for Node.js. During parsing it runs a legacy decoding pass over the scheme component and never re-escapes the result, and serialization writes the scheme back out verbatim, unlike the host component which is re-escaped. As a result an input whose scheme carries percent-encoded slashes parses as a scheme with no authority, so the parsed host and error are both undefined, yet resolving or normalizing that same input emits a network-path reference whose authority is attacker-chosen and re-parses to that host. An application that allowlists on the parsed host, or treats a reference with no authority as safe to resolve against its base, gets the opposite of what it checked, giving an off-site redirect, server-side request forgery, or address-policy bypass. The legacy decoder also expands non-standard escape forms, widening the issue past upstream filters, and control characters in the scheme can reach the output as raw carriage return and line feed. The affected versions are 2.3.1 up to but not including 2.4.5, 3.0.0 up to but not including 3.1.6, and 4.0.0 up to but not including 4.1.3. The issue is fixed in 2.4.5, 3.1.6, and 4.1.3, which reject a scheme that is not valid after decoding. Users should upgrade to a patched version.
📍 영향받는 시스템
fast-uri versions 2.3.1 <= v < 2.4.5, 3.0.0 <= v < 3.1.6, 4.0.0 <= v < 4.1.3
⚔️ 공격 벡터
인코딩된 슬래시(/)가 포함된 스킴을 사용하여 파싱 로직을 속이고 권한(authority)을 탈취하는 방식
🛡️ 대응 방법
fast-uri를 패치된 버전인 2.4.5, 3.1.6 또는 4.1.3 이상으로 업그레이드하십시오.
🔧 검증 코드
출력된 fast-uri의 버전을 확인하여 취약한 범위에 해당하는지 체크합니다.