
# CVE-2021-23410 msgpack PoC 저장소 msgpack의 CVE-2021-23410에 대한 개념 증명을 시연하는 테스트 저장소로, 보고된 역직렬화 취약점이 실제로 악용 가능한지 분석합니다.
https://snyk.io/vuln/SNYK-JS-MSGPACK-1296122 테스트
이것은 취약점이 아닌 것 같습니다.
var assert = require('assert');
var msgpack = require('msgpack');
function sleep(ms) {
return new Promise((resolve) => {
setTimeout(resolve, ms);
});
}
async function init() {
var normal = { "a": 1, "b": 2, "c": [1, 2, 3] };
var malicious = msgpack.pack({
exploit: function () {
// Note(by @azu): This Poc just run child_process.exec
// It is not related to msgpack
require('child_process').exec('echo code_executed!;sleep 3', function (error, stdout, stderr) {
console.log(stdout)
});
}(),
});
var rce = msgpack.unpack(malicious);
assert.deepEqual(rce, normal);
}
init();
PoC by Adi Malyanker
이 PoC는 단지 child_pross.exec를 실행할 뿐이므로, 이것은 msgpack의 취약점이 아닙니다.
git clone [email protected]:azu/msgpack-CVE-2021-23410-test.git
cd msgpack-CVE-2021-23410-test
npm install
npm test