🇰🇷 한글 설명
Node.js용 URI 파서인 fast-uri에서 호스트 이름을 처리할 때 퍼센트 인코딩된 대문자 옥텟을 소문자로 변환하지 못하는 취약점이 발견되었습니다. 이로 인해 호스트 이름의 대소문자 구분 여부에 따라 보안 검사(허용/차단 목록)를 우회할 수 있는 논리적 오류가 발생합니다.
💡 쉬운 설명
웹 주소를 분석하는 도구가 대문자가 섞인 특수 코드를 제대로 처리하지 못해 발생하는 문제입니다. 공격자가 주소를 교묘하게 변형하면 보안 필터를 통과하여 허용되지 않은 사이트에 접속할 수 있습니다.
🇺🇸 원문 (English)
fast-uri is a dependency-free RFC 3986 URI parser for Node.js, used by Fastify and ajv. In versions before 2.4.7, from 3.0.0 through 3.1.7, and from 4.0.0 through 4.1.4, fast-uri folds the host to lowercase before it percent-decodes the host, so a percent-encoded uppercase octet such as %41 decodes to a literal A that is never folded. For a scheme-relative reference such as //host there is no scheme, so the host canonicalization that would normally repair this does not run, and parse, normalize, and equal then disagree on the same host. An application that makes a case-sensitive host decision on fast-uri output, for example a host allowlist or denylist that compares the parsed host or uses equal, can be steered past the check with a percent-encoded uppercase octet, and because hostnames are case-insensitive in DNS and HTTP the evading spelling still reaches the host the check meant to gate. The issue is fixed in fast-uri 2.4.7, 3.1.8, and 4.1.5, and users should upgrade to one of those versions or later. As a workaround, compare hosts case-insensitively by lowercasing the parsed host before any allowlist or denylist decision.
📍 영향받는 시스템
fast-uri versions < 2.4.7, 3.1.8, 4.1.5 (specifically 3.0.0-3.1.7 and 4.0.0-4.1.4)
⚔️ 공격 벡터
퍼센트 인코딩된 대문자(예: %41)를 포함한 호스트 이름을 사용하여 호스트 이름 검증 로직을 우회함
🛡️ 대응 방법
fast-uri를 2.4.7, 3.1.8 또는 4.1.5 이상의 버전으로 업데이트하거나, 검증 전 호스트 이름을 소문자로 변환하여 비교함
🔧 검증 코드
출력된 fast-uri의 버전을 확인하여 취약한 버전 범위에 해당하는지 체크함