🇰🇷 한글 설명
Axios 라이브러리의 XSRF 토큰 보호 로직에서 정확한 boolean 비교 대신 JavaScript의 truthy/falsy 의미론을 사용하여, 프로토타입 오염이나 잘못된 설정으로 인해 XSRF 토큰이 교차 출처 서버로 전송될 수 있습니다. 이로 인해 공격자가 제어하는 크로스 사이트 요청 위조(XSRF) 공격이 가능해집니다.
💡 쉬운 설명
Axios 라이브러리의 보안 설정 확인 방식이 불완전해서 토큰이 다른 웹사이트로 유출될 수 있습니다. 공격자가 이를 이용해 사용자 권한으로 악의적인 작업을 수행할 수 있습니다.
🇺🇸 원문 (English)
Axios is a promise based HTTP client for the browser and Node.js. Prior to 1.15.1 and 0.31.1, the Axios library's XSRF token protection logic uses JavaScript truthy/falsy semantics instead of strict boolean comparison for the withXSRFToken config property. When this property is set to any truthy non-boolean value (via prototype pollution or misconfiguration), the same-origin check (isURLSameOrigin) is short-circuited, causing XSRF tokens to be sent to all request targets including cross-origin servers controlled by an attacker. This vulnerability is fixed in 1.15.1 and 0.31.1.
📍 영향받는 시스템
Axios 1.15.1 미만, 0.31.1 미만 버전
⚔️ 공격 벡터
프로토타입 오염(Prototype Pollution) 또는 잘못된 withXSRFToken 설정을 통해 XSRF 토큰을 크로스 도메인 요청에 자동 전송
🛡️ 대응 방법
Axios를 1.15.1 이상 또는 0.31.1 이상으로 업그레이드
🔧 검증 코드
출력된 버전이 1.15.1 이상(또는 0.31.1 이상)이면 안전하고, 그 이하면 즉시 업그레이드 필요
npm list axios 2>/dev/null | grep axios | head -1