🇰🇷 한글 설명
fast-uri 라이브러리의 normalize() 및 serialize() 함수가 RFC 3986 규정을 잘못 적용하여 상대 경로의 상위 디렉토리 세그먼트를 삭제할 수 있는 취약점입니다. 이로 인해 공격자가 입력한 상대 경로가 루트 상대 경로로 변하여 의도하지 않은 리소스에 접근할 수 있습니다. 해당 문제는 2.4.8, 3.1.9, 4.2.3 버전 이상에서 수정되었습니다.
💡 쉬운 설명
주소를 정리하는 과정에서 실수로 경로의 앞부분을 지워버려, 원래 접근하면 안 되는 폴더로 연결될 수 있는 문제입니다. 공격자가 이 점을 이용해 보안 검사를 우회하고 다른 파일에 접근할 위험이 있습니다.
🇺🇸 원문 (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, the normalize() and serialize() functions apply RFC 3986 dot-segment removal to the path of a relative-path reference, even though that algorithm is defined only for the merged target path during resolution, so a leading parent-directory segment can be dropped and a document-relative reference can become root-relative. An application that normalizes an attacker-supplied or user-supplied relative reference and then resolves it, or uses it as a cache, deduplication, or authorization key, can have the reference escape its intended directory and point at a different resource. 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, resolve a relative reference against its absolute base first and normalize the absolute result instead of normalizing the reference beforehand.
📍 영향받는 시스템
fast-uri < 2.4.8, 3.0.0 <= 3.1.8, 4.0.0 <= 4.2.2
⚔️ 공격 벡터
공격자가 조작된 상대 경로를 입력하여 애플리케이션의 경로 정규화 및 리소스 접근 로직을 우회함
🛡️ 대응 방법
fast-uri를 2.4.8, 3.1.9 또는 4.2.3 이상의 버전으로 업데이트하십시오.
🔧 검증 코드
출력된 fast-uri의 버전을 확인하여 취약한 버전 범위에 해당하는지 체크합니다.