🇰🇷 한글 설명
re2의 Node.js 바인딩에서 lastIndex 검증 시 UTF-8 바이트 길이와 UTF-16 코드 유닛 오프셋 간의 불일치가 발생합니다. 공격자가 조작된 lastIndex를 비ASCII 대상 문자열에 사용하면 힙 영역 외부 읽기 및 프로세스 충돌이 발생할 수 있습니다.
💡 쉬운 설명
특수하게 만들어진 문자를 처리할 때 프로그램이 계산 착오를 일으켜 메모리 오류를 발생시킵니다. 이로 인해 프로그램이 갑자기 꺼지거나 일부 메모리 정보가 유출될 위험이 있습니다.
🇺🇸 원문 (English)
re2 provides Node.js bindings for Google's RE2 regular expression engine. Prior to 1.25.2, re2 validates lastIndex against the UTF-8 byte length of a subject but uses it as a UTF-16 code-unit offset in exec, test, match, replace, and split, allowing an attacker-influenced lastIndex on a non-ASCII subject to trigger an out-of-bounds heap read and an uncatchable process crash, with limited heap information disclosure in some cases. This issue is fixed in 1.25.2.
📍 영향받는 시스템
re2 Node.js bindings version 1.25.2 미만
⚔️ 공격 벡터
비ASCII 문자가 포함된 문자열에 조작된 lastIndex 값을 전달하여 공격
🛡️ 대응 방법
re2 패키지를 1.25.2 버전 이상으로 업데이트
🔧 검증 코드
출력된 re2의 버전이 1.25.2 미만인지 확인