🇰🇷 한글 설명
on-headers Node.js 미들웨어의 버그로 인해 response.writeHead()에 배열을 전달할 때 응답 헤더가 의도치 않게 수정될 수 있습니다. 1.1.0 이상의 버전으로 업그레이드하거나 배열 대신 객체를 사용하여 문제를 해결할 수 있습니다.
💡 쉬운 설명
Node.js 웹 애플리케이션에서 응답 헤더 처리 방식에 따라 헤더 정보가 손상될 수 있는 문제입니다. 특정 방식으로 프로그래밍하면 원하지 않은 헤더 수정이 발생할 수 있습니다.
🇺🇸 원문 (English)
on-headers is a node.js middleware for listening to when a response writes headers. A bug in on-headers versions `<1.1.0` may result in response headers being inadvertently modified when an array is passed to `response.writeHead()`. Users should upgrade to version 1.1.0 to receive a patch. Uses are strongly encouraged to upgrade to `1.1.0`, but this issue can be worked around by passing an object to `response.writeHead()` rather than an array.
📍 영향받는 시스템
on-headers < 1.1.0 (Node.js 미들웨어)
⚔️ 공격 벡터
response.writeHead()에 배열을 전달하여 응답 헤더를 의도치 않게 수정
🛡️ 대응 방법
on-headers를 1.1.0 이상으로 업그레이드하거나 writeHead()에 배열 대신 객체 사용
🔧 검증 코드
설치된 on-headers의 버전을 확인하여 1.1.0 이상인지 확인합니다. 1.1.0 미만이면 업그레이드 필요합니다.
npm list on-headers 2>/dev/null | grep 'on-headers'