🇰🇷 한글 설명
undici 라이브러리가 Set-Cookie 헤더를 파싱할 때 SameSite 속성 값을 정확히 일치시키지 않고 특정 문자열이 포함되어 있으면 허용하는 취약점입니다. 이로 인해 공격자가 의도적으로 설정한 값이 표준 값(Strict, Lax, None) 중 하나로 잘못 매핑되어 보안 정책이 약화될 수 있습니다.
💡 쉬운 설명
쿠키의 보안 설정을 확인하는 과정에서 글자가 완전히 일치하지 않아도 대충 비슷한 글자만 있으면 통과시켜 버리는 문제입니다. 이 때문에 보안이 강력해야 할 쿠키가 보안이 약한 상태로 설정되어 공격에 노출될 수 있습니다.
🇺🇸 원문 (English)
Impact:
When undici parses a Set-Cookie header, it accepts any SameSite attribute value that contains Strict, Lax, or None as a substring, rather than the case-insensitive exact match specified by RFC 6265. Non-spec values are silently mapped to one of the three standard tokens. For example, SameSite=NoneOfYourBusiness is parsed as None (the most permissive setting), and SameSite=StrictLax is parsed as Lax (a downgrade from Strict).
Affected applications are those that consume Set-Cookie headers from server responses (for example via undici's fetch or proxy code paths) and then forward or rely on the parsed sameSite attribute. A malicious or non-compliant server can coerce the consumer's view of a cookie's SameSite policy to a weaker value, silently degrading the SameSite enforcement the cookie is supposed to provide.
This was introduced in undici 5.15.0 when the cookies feature was added.
Patches:
Upgrade to undici v6.26.0, v7.28.0 or v8.5.0.
Workarounds:
After parsing a Set-Cookie header, validate that the resulting sameSite attribute is one of 'Strict', 'Lax', or 'None' (exact, case-insensitive) before forwarding or relying on it.
📍 영향받는 시스템
undici v5.15.0 이상 (v6.26.0, v7.28.0, v8.5.0 미만 버전)
⚔️ 공격 벡터
악의적인 서버가 표준을 따르지 않는 SameSite 값을 포함한 Set-Cookie 헤더를 응답하여 클라이언트의 보안 정책을 강제로 낮춤
🛡️ 대응 방법
undici를 v6.26.0, v7.28.0 또는 v8.5.0 이상의 최신 버전으로 업그레이드하십시오.
🔧 검증 코드
출력된 undici의 버전을 확인하여 취약한 버전 범위(5.15.0 이상 ~ 패치 버전 미만)에 해당하는지 확인합니다.
npm list undici | grep undici
📊 CVSS Vector String
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N
💻 영향받는 소프트웨어
IBM WebSphere Application Server