Executive brief
Protobufjs is a JavaScript library used to serialize and deserialize Protocol Buffer messages. A prototype pollution flaw allows attackers to inject malicious properties into core JavaScript objects, potentially compromising applications that parse untrusted .proto files or pass user input to certain library functions. This could lead to data tampering, injection attacks, or application logic manipulation.
Technical details
The vulnerability is a prototype pollution flaw (CWE-1321) in protobufjs affecting versions 6.10.0–6.10.3 and 6.11.0–6.11.3. The root cause lies in the util.setProperty and ReflectionObject.setParsedOption functions, which do not properly validate property names before modifying objects, allowing attackers to pollute Object.prototype. An attacker can exploit this by providing malicious input to these functions or by parsing a crafted .proto file. The vulnerability requires no authentication or user interaction beyond parsing untrusted protocol buffer definitions. Patches are available in versions 6.10.4+ and 6.11.4+.
Affected products
- protobufjs protobufjs 6.10.0 through 6.10.3, 6.11.0 through 6.11.3
Timeline
- 2022-05-28: disclosed
- 2022-05-20: patched: fix merged in PR #1731