json-schema-ref-parser is an NPM package for Parse, Resolve, and Dereference JSON Schema $ref pointers.
Affected versions of this package are vulnerable to Prototype Pollution. An attacker can manipulate the prototype of an object, potentially leading to the alteration of behavior of all objects inheriting from the affected prototype by passing specially crafted input to this function.
Details:
The vulnerable functions: `bundle()`, `parse()`, `resolve()`, `dereference()` passes the argument "options" to an unsafe merge method, which recursively copy properties from one object to another. Such a function has the potential to modify any object reachable from the destination object,
and the built-in Object.prototype is usually reachable through the special properties __proto__ and constructor.prototype.
Thus, the attacker can use one of these properties to pollute the application logic that can be escalated to Denial of service,
remote code execution or cross-site scripting attacks.
Overview
json-schema-ref-parser is an NPM package for Parse, Resolve, and Dereference JSON Schema $ref pointers.
Affected versions of this package are vulnerable to Prototype Pollution. An attacker can manipulate the prototype of an object, potentially leading to the alteration of behavior of all objects inheriting from the affected prototype by passing specially crafted input to this function.
Details:
The vulnerable functions: `bundle()`, `parse()`, `resolve()`, `dereference()` passes the argument "options" to an unsafe merge method, which recursively copy properties from one object to another. Such a function has the potential to modify any object reachable from the destination object, and the built-in Object.prototype is usually reachable through the special properties __proto__ and constructor.prototype. Thus, the attacker can use one of these properties to pollute the application logic that can be escalated to Denial of service, remote code execution or cross-site scripting attacks.
The call stack :
PoC:
sent in a private message to the maintainer
How to prevent: