🔍 CVE-2022-35949

5.3
CVSS Score
MEDIUM
2022-08-12
2026-06-17 04:52
✅ 완료

🇰🇷 한글 설명

Node.js용 HTTP/1.1 클라이언트인 undici에서 발생하는 SSRF(서버 측 요청 위조) 취약점입니다. 사용자가 입력한 값이 pathname 옵션에 포함될 경우, 의도치 않게 호스트네임이 변경되어 공격자가 지정한 내부 서버로 요청을 보낼 수 있습니다. 이 문제는 undici 5.8.1 버전에서 수정되었습니다.

💡 쉬운 설명

웹사이트가 외부 주소를 불러올 때, 공격자가 입력한 특수 문자를 이용해 웹사이트가 원래 가려던 곳이 아닌 내부의 중요한 서버로 접속하게 만드는 공격입니다. 마치 배달 주소에 '옆집 말고 우리 집 안방으로'라고 적어 보내는 것과 같습니다.

🇺🇸 원문 (English)

undici is an HTTP/1.1 client, written from scratch for Node.js.`undici` is vulnerable to SSRF (Server-side Request Forgery) when an application takes in **user input** into the `path/pathname` option of `undici.request`. If a user specifies a URL such as `http://127.0.0.1` or `//127.0.0.1` ```js const undici = require("undici") undici.request({origin: "http://example.com", pathname: "//127.0.0.1"}) ``` Instead of processing the request as `http://example.org//127.0.0.1` (or `http://example.org/http://127.0.0.1` when `http://127.0.0.1 is used`), it actually processes the request as `http://127.0.0.1/` and sends it to `http://127.0.0.1`. If a developer passes in user input into `path` parameter of `undici.request`, it can result in an _SSRF_ as they will assume that the hostname cannot change, when in actual fact it can change because the specified path parameter is combined with the base URL. This issue was fixed in `[email protected]`. The best workaround is to validate user input before passing it to the `undici.request` call.

📍 영향받는 시스템

undici 버전 5.8.1 미만

⚔️ 공격 벡터

undici.request의 pathname 옵션에 사용자 입력값을 검증 없이 전달하여 호스트네임을 조작함

🛡️ 대응 방법

undici를 5.8.1 이상의 버전으로 업데이트하거나, 사용자 입력값에 대해 엄격한 유효성 검사를 수행함

🔧 검증 코드

출력된 undici의 버전을 확인하여 5.8.1 미만인지 확인합니다.

Shell / Script
npm list undici | grep undici

📊 CVSS Vector String

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

💻 영향받는 소프트웨어

Node.js