🇰🇷 한글 설명
fast-uri 라이브러리가 URI의 scheme 부분을 검증하기 전에 legacy unescape() 함수를 사용하여 퍼센트 디코딩을 수행하는 취약점입니다. 이로 인해 RFC 3986 표준을 위반하는 인코딩된 scheme이 유효한 것으로 처리되어, 보안 필터를 우회하고 XSS 공격을 유발할 수 있습니다.
💡 쉬운 설명
주소창에 입력된 특수 문자를 잘못 해석하여 보안 검사를 통과한 뒤, 악성 스크립트를 실행하게 만드는 보안 구멍이 발견되었습니다. 공격자가 이를 이용하면 웹사이트에서 원치 않는 동작을 실행하게 만들 수 있습니다.
🇺🇸 원문 (English)
fast-uri is a dependency-free RFC 3986 URI parser and serializer for Node.js. In versions before 2.4.8, from 3.0.0 through 3.1.8, and from 4.0.0 through 4.2.2, fast-uri percent-decodes the scheme component with the legacy global unescape() function before validating it, so an input whose decoded scheme is a dangerous token is emitted as a live scheme even though RFC 3986 does not allow percent-encoding in a scheme and no other parser accepts it. An application that screens dangerous schemes on the raw input and then stores or renders the normalized or resolved result can turn an inert string into an executable javascript, data, or vbscript URL, producing a stored or reflected cross-site scripting vector, and the equal() comparison treats an encoded and a plain scheme as the same, which can bypass equality-based allowlists. The issue is fixed in fast-uri 2.4.8, 3.1.9, and 4.2.3, and users should upgrade to one of these versions or later. As a workaround, reject input whose scheme part contains a percent sign, or check the parsed scheme against an allowlist after normalization and use that same parsed result rather than the raw string.
📍 영향받는 시스템
fast-uri < 2.4.8, 3.0.0-3.1.8, 4.0.0-4.2.2
⚔️ 공격 벡터
인코딩된 scheme을 포함한 URI를 입력하여 보안 필터링 및 화이트리스트 검사를 우회한 후 XSS 공격 수행
🛡️ 대응 방법
fast-uri를 2.4.8, 3.1.9 또는 4.2.3 이상의 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 fast-uri의 버전이 취약한 범위(2.4.8 미만, 3.1.9 미만, 4.2.3 미만)에 해당하는지 확인하십시오.