Closed functionofpwnosec closed 4 weeks ago
This PR has been marked as stale after 7 or more days of inactivity. Please have a maintainer add the on hold
label if this PR should remain open. If there is no further activity or the on hold
label is not added, this PR will be closed in 3 days.
Description
A user-controlled protobuf message can be used by an attacker to pollute the prototype of Object.prototype by adding and overwriting its data and functions. Exploitation can involve: (1) using the function parse to parse protobuf messages on the fly, (2) loading .proto files by using load/loadSync functions, or (3) providing untrusted input to the functions ReflectionObject.setParsedOption and util.setProperty. NOTE: this CVE Record is about
Object.constructor.prototype.<new-property> = ...; whereas
was aboutObject.__proto__.<new-property> = ...;
instead.Prototype Pollution is a vulnerability affecting JavaScript. Prototype Pollution refers to the ability to inject properties into existing JavaScript language construct prototypes, such as objects. JavaScript allows all Object attributes to be altered, including their magical attributes such as proto, constructor and prototype. An attacker manipulates these attributes to overwrite, or pollute, a JavaScript application object prototype of the base object by injecting other values. Properties on the Object.prototype are then inherited by all the JavaScript objects through the prototype chain. When that happens, this leads to either denial of service by triggering JavaScript exceptions, or it tampers with the application source code to force the code path that the attacker injects, thereby leading to remote code execution.
Vulnerability Description
Using the
parse
functionsetParsedOption
function of aReflectionObject
Using the function
util.setProperty
Impact and Risks
An attacker-controlled object, e.g. data in JSON format received over the network and parsed by the application using tree-kit's extend function, can be used to pollute the prototype of the Object.prototype by adding and overwriting its data and functions. These data and functions will be available in all objects created henceforth. Depending on the application that uses the tree-kit library, this vulnerability can result in follow-up issues, such as:
CVE-2023-36665 CWE-1321