🇰🇷 한글 설명
i18next-fs-backend 2.6.4 이전 버전에서 사용자 입력 매개변수(lng/ns)를 경로 템플릿에 검증 없이 직접 대입하여 발생하는 경로 조회(Path Traversal) 취약점입니다. 공격자는 HTTP 요청을 통해 이를 조작하여 의도된 로케일 디렉토리 외부의 임의 파일을 읽거나 덮어쓸 수 있습니다.
💡 쉬운 설명
웹앱이 사용자가 선택한 언어 설정을 제대로 검증하지 않아서, 공격자가 '../../../' 같은 기호를 섞어서 시스템의 중요 파일(예: /etc/passwd)에 접근할 수 있습니다. 이는 마치 수표 금액 쓰는 부분만 검사하고 '받는 사람' 란은 안 보는 것과 같습니다.
🇺🇸 원문 (English)
i18next-fs-backend is a backend layer for i18next using in Node.js and for Deno to load translations from the filesystem. Prior to version 2.6.4, i18next-fs-backend substitutes the lng and ns options directly into the configured loadPath / addPath templates and then read / write the resulting file from disk. The interpolation is unencoded and unvalidated, so a crafted lng or ns value — containing .., a path separator, a control character, a prototype key, or simply an unexpectedly long string — allows an attacker who can influence either value to read or overwrite files outside the intended locale directory. When lng / ns are derived from untrusted input (request-scoped i18next instances behind an HTTP layer such as i18next-http-middleware, or any framework that lets the end user pick the language via query string, cookie, or header), a single request such as ?lng=../../../../etc/passwd causes the backend to attempt to read that path. This issue has been patched in version 2.6.4.
📍 영향받는 시스템
i18next-fs-backend < 2.6.4
⚔️ 공격 벡터
HTTP 요청의 query string, cookie, header를 통해 lng/ns 매개변수에 경로 조회 시퀀스(../, 절대경로) 주입
🛡️ 대응 방법
i18next-fs-backend를 2.6.4 이상으로 즉시 업그레이드
🔧 검증 코드
설치된 버전이 2.6.4 이상으로 표시되면 패치됨. 2.6.4 미만이거나 패키지 미설치면 취약하거나 영향 없음.
npm list i18next-fs-backend 2>/dev/null | grep -A1 'i18next-fs-backend'