🇰🇷 한글 설명
msgpack5 라이브러리에서 '__proto__' 키를 포함한 데이터를 디코딩할 때 발생하는 프로토타입 오염(Prototype Poisoning) 취약점입니다. 공격자가 조작된 MessagePack 데이터를 전송하면 디코딩된 객체의 프로토타입이 의도치 않은 값으로 설정되어 예외가 발생하거나 예상치 못한 동작을 유발할 수 있습니다.
💡 쉬운 설명
데이터를 읽어오는 과정에서 특수한 키를 이용해 객체의 설계도를 조작하는 공격입니다. 이로 인해 프로그램이 갑자기 멈추거나 잘못된 계산 결과를 내놓을 수 있습니다.
🇺🇸 원문 (English)
msgpack5 is a msgpack v5 implementation for node.js and the browser. In msgpack5 before versions 3.6.1, 4.5.1, and 5.2.1 there is a "Prototype Poisoning" vulnerability. When msgpack5 decodes a map containing a key "__proto__", it assigns the decoded value to __proto__. Object.prototype.__proto__ is an accessor property for the receiver's prototype. If the value corresponding to the key __proto__ decodes to an object or null, msgpack5 sets the decoded object's prototype to that value. An attacker who can submit crafted MessagePack data to a service can use this to produce values that appear to be of other types; may have unexpected prototype properties and methods (for example length, numeric properties, and push et al if __proto__'s value decodes to an Array); and/or may throw unexpected exceptions when used (for example if the __proto__ value decodes to a Map or Date). Other unexpected behavior might be produced for other types. There is no effect on the global prototype. This "prototype poisoning" is sort of a very limited inversion of a prototype pollution attack. Only the decoded value's prototype is affected, and it can only be set to msgpack5 values (though if the victim makes use of custom codecs, anything could be a msgpack5 value). We have not found a way to escalate this to true prototype pollution (absent other bugs in the consumer's code). This has been fixed in msgpack5 version 3.6.1, 4.5.1, and 5.2.1. See the referenced GitHub Security Advisory for an example and more details.
📍 영향받는 시스템
msgpack5 versions before 3.6.1, 4.5.1, and 5.2.1
⚔️ 공격 벡터
조작된 '__proto__' 키를 포함한 MessagePack 데이터를 서비스에 전송
🛡️ 대응 방법
msgpack5를 버전 3.6.1, 4.5.1 또는 5.2.1 이상으로 업데이트
🔧 검증 코드
출력된 msgpack5의 버전이 취약한 버전 범위(3.6.1, 4.5.1, 5.2.1 미만)에 해당하는지 확인