🇰🇷 한글 설명
i18next-http-middleware가 사용자 입력 언어값을 Content-Language 응답 헤더에 작성할 때 CRLF 문자를 제거하지 않아 CRLF 인젝션 공격이 가능합니다. 공격자는 lng 파라미터에 캐리지 리턴과 라인피드를 삽입하여 HTTP 응답 헤더를 조작할 수 있습니다. 버전 3.9.3에서 패치되었습니다.
💡 쉬운 설명
웹 애플리케이션이 사용자가 보낸 언어 정보를 응답 헤더에 그대로 담아 보내는데, 악의적인 특수문자를 삽입하면 헤더가 왜곡됩니다. 이를 통해 공격자가 응답을 조작하여 보안 문제를 일으킬 수 있습니다.
🇺🇸 원문 (English)
i18next-http-middleware is a middleware to be used with Node.js web frameworks like express or Fastify and also for Deno. Prior to version 3.9.3, i18next-http-middleware wrote user-controlled language values into the Content-Language response header after passing them through utils.escape(), which is an HTML-entity encoder that does not strip carriage return, line feed, or other control characters. When the application used an older i18next (< 19.5.0) that still exercised the backward-compatibility fallback at LanguageDetector.js:100 or otherwise produced a raw detected value, CRLF sequences in the attacker-controlled lng parameter reached res.setHeader('Content-Language', ...) verbatim. This issue has been patched in version 3.9.3.
📍 영향받는 시스템
i18next-http-middleware < 3.9.3 (특히 i18next < 19.5.0과 함께 사용 시)
⚔️ 공격 벡터
GET/POST 요청의 lng 파라미터에 CRLF 시퀀스(%0d%0a)를 삽입하여 HTTP 응답 헤더 주입
🛡️ 대응 방법
i18next-http-middleware를 3.9.3 이상으로 업그레이드 (npm update i18next-http-middleware)
🔧 검증 코드
표시된 버전이 3.9.3 이상이면 안전, 3.9.3 미만이면 즉시 업그레이드 필요
npm ls i18next-http-middleware --depth=0 2>/dev/null | grep -E 'i18next-http-middleware@'