🇰🇷 한글 설명
i18next-http-middleware 3.9.3 이전 버전에서 사용자 입력인 lng과 ns 파라미터를 검증하지 않고 i18next.services.backendConnector.load()에 직접 전달하는 취약점입니다. 이로 인해 설정된 백엔드에 따라 경로 이동(path traversal) 또는 SSRF(Server-Side Request Forgery) 공격이 가능합니다.
💡 쉬운 설명
i18next-http-middleware의 언어 및 네임스페이스 설정 기능에서 사용자 입력을 제대로 검증하지 않아, 공격자가 파일 시스템에 임의로 접근하거나 서버가 의도하지 않은 외부 서버에 요청하도록 할 수 있습니다. 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 passes the user-controlled lng and ns values from getResourcesHandler directly into i18next.services.backendConnector.load(languages, namespaces, …) without any sanitization. Depending on which backend is configured, the unvalidated path segments enable either path traversal or SSRF. This issue has been patched in version 3.9.3.
📍 영향받는 시스템
i18next-http-middleware < 3.9.3 (Express, Fastify, Deno 지원)
⚔️ 공격 벡터
GET/POST 요청의 lng, ns 쿼리 파라미터에 경로 이동 페이로드(예: ../, ../../ 등)를 삽입하여 공격 실행
🛡️ 대응 방법
npm update i18next-http-middleware를 실행하여 3.9.3 이상으로 업그레이드
🔧 검증 코드
출력 결과에서 버전 번호가 3.9.3 이상이면 안전, 3.9.3 미만이거나 설치되지 않았으면 취약
npm list i18next-http-middleware 2>/dev/null | grep i18next-http-middleware