Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-107301 Overview
CVE-2026-107301 is a prototype pollution vulnerability [CWE-1321] in msgpack5, a MessagePack v5 implementation for Node.js and the browser. Versions prior to 6.1.0 fail to apply the default protoAction: 'error' protection when the library is instantiated with an empty or partial options object. An attacker can craft a MessagePack map containing a __proto__ key that, when decoded, replaces the decoded object's prototype. The flaw does not modify Object.prototype globally, but it can alter inherited properties and downstream behavior in applications that trust decoded data. The maintainers fixed the issue in msgpack5 version 6.1.0.
Critical Impact
Decoded MessagePack payloads can override an object's prototype, affecting integrity of inherited properties when applications instantiate msgpack5 with a partial options object.
Affected Products
- msgpack5 versions prior to 6.1.0
- Node.js applications consuming untrusted MessagePack data through msgpack5
- Browser applications bundling vulnerable msgpack5 releases
Discovery Timeline
- 2026-10-08 - CVE-2026-107301 published to NVD
- 2026-10-14 - Last updated in NVD database
Technical Details for CVE-2026-107301
Vulnerability Analysis
The root defect lies in how msgpack5 initializes its runtime options. When a caller passes an empty or partial options object, the library skips the branch that would have set protoAction to its secure default of 'error'. The decoder then processes MessagePack map keys without rejecting the reserved __proto__ key. A map entry whose key equals __proto__ is assigned directly onto the decoded object, replacing its prototype chain. Applications relying on inherited properties, such as default methods or configuration flags, may receive attacker-controlled values. Confidentiality is not directly impacted, but integrity-sensitive logic such as access checks, feature flags, and serialization routines may misbehave after decoding hostile input.
Root Cause
The constructor used the pattern options = options || { ...defaults }, which only applied defaults when options was entirely falsy. Supplying {} or an object missing protoAction left that field undefined, and the subsequent decoder treated the missing value as a signal to accept __proto__ keys instead of throwing. The error-by-default guarantee advertised by the project was therefore silently disabled by common usage patterns.
Attack Vector
Exploitation requires the target application to decode attacker-controlled MessagePack payloads using a vulnerable msgpack5 instance constructed with a partial options object. The attacker encodes a map that contains the __proto__ key with a chosen value. When the receiver decodes it, the resulting JavaScript object has its prototype replaced. Attack complexity is elevated because exploitation depends on how the host application consumes the decoded object. No authentication or user interaction is required when the decoding endpoint is network-reachable.
// Patch excerpt from msgpack5 index.js / dist/msgpack5.js
// Source: https://github.com/mcollina/msgpack5/commit/20e82600ac9462e679c8a45e5723315f21e2c774
const encodingTypes = []
const decodingTypes = new Map()
- options = options || {
+ options = Object.assign({
forceFloat64: false,
compatibilityMode: false,
// if true, skips encoding Dates using the msgpack
// timestamp ext format (-1)
disableTimestampEncoding: false,
preferMap: false,
- // options.protoAction: 'error' (default) / 'remove' / 'ignore'
protoAction: 'error'
+ }, options || {})
+
+ if (options.protoAction === undefined) options.protoAction = 'error'
+ if (options.protoAction !== 'error' && options.protoAction !== 'remove' && options.protoAction !== 'ignore') {
+ throw new TypeError('protoAction must be "error", "remove", or "ignore"')
}
validateMaxLength(options.maxArrayLength, 'maxArrayLength')
The patch replaces the fragile || fallback with Object.assign, ensuring every default is merged. It then explicitly re-asserts protoAction = 'error' when callers omit the field and validates the allowed values. See the GitHub Security Advisory GHSA-8hq7-ggx2-cc6m for the maintainer narrative.
Detection Methods for CVE-2026-107301
Indicators of Compromise
- MessagePack payloads containing the string literal __proto__ as a map key when decoded by server-side handlers.
- Decoded objects whose prototype no longer matches Object.prototype or whose inherited properties were unexpectedly replaced.
- Application logs showing runtime errors in code paths that previously relied on default prototype methods such as hasOwnProperty or toString.
Detection Strategies
- Perform a software composition analysis scan of package-lock.json and yarn.lock for msgpack5 versions earlier than 6.1.0.
- Grep source code for require('msgpack5')( or msgpack5( calls to confirm whether callers pass an options object and whether protoAction is explicitly set.
- Inspect ingress payloads processed by MessagePack endpoints for 0xa9 or 0xd9 length prefixes followed by the __proto__ byte sequence.
Monitoring Recommendations
- Enable structured logging on decoding boundaries so unexpected prototype mutations and TypeError conditions become visible to the SOC.
- Instrument runtime assertions that validate decoded objects conform to expected schemas before downstream processing.
- Alert on repeated decode failures from the same client, which may indicate exploitation attempts after upgrading to 6.1.0.
How to Mitigate CVE-2026-107301
Immediate Actions Required
- Upgrade msgpack5 to version 6.1.0 or later across all production, staging, and build environments.
- Rebuild and redeploy browser bundles that embed msgpack5 so vulnerable copies are no longer served to clients.
- Audit all call sites that construct msgpack5 to confirm protoAction is explicitly set to 'error' or 'remove'.
Patch Information
The fix shipped in msgpack5 v6.1.0 via commit 20e82600ac9462e679c8a45e5723315f21e2c774. The patch merges defaults with Object.assign, reinstates protoAction = 'error' when omitted, and rejects invalid values with a TypeError.
Workarounds
- Explicitly pass { protoAction: 'error' } or { protoAction: 'remove' } to every msgpack5() constructor until upgrading is possible.
- Validate decoded objects against a strict schema and reject any map containing the reserved __proto__, constructor, or prototype keys.
- Isolate MessagePack decoding behind a dedicated service that treats all input as untrusted and sanitizes output before passing it to business logic.
# Upgrade msgpack5 to the patched release
npm install msgpack5@^6.1.0
# Verify the installed version no longer contains the vulnerability
npm ls msgpack5
# Enforce the secure option explicitly in application code
# const msgpack = require('msgpack5')({ protoAction: 'error' })
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

