GHSA-82JV-9WJW-PQH6

GHSA-82JV-9WJW-PQH6 is a low-severity security vulnerability in derby (npm), affecting versions <= 2.3.1. It is fixed in 2.3.2, 3.0.2, 4.0.0-beta.11.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

Prototype pollution in emit function

A prototype pollution in derby can crash the application, if the application author has atypical HTML templates that feed user input into an object key.

Attribute keys are almost always developer-controlled, not end-user-controlled, so this shouldn't be an issue in practice for most applications.

Details

emit(context: Context, target: T) {
  const node = traverseAndCreate(context.controller, this.segments);
    node[this.lastSegment] = target;
    this.addListeners(target, node, this.lastSegment);
}

The emit() function in src/templates/templates.ts is called without sanitizing the variable this.lastSegment . The variable this.lastSegment can be set to __proto__, and this will pollute the prototype of Javascipt Object (node['__proto__'] = target).

PoC

To reproduce this vulnerability, you can adjust the test case ignores DOM mutations in components\' create() in test/dom/ComponentHarness.mocha.js.

it('ignores DOM mutations in components\' create()', function() {
      function Box() {}
      Box.view = {
        is: 'box',
-        source: '<index:><div class="box" as="boxElement"></div>'
+        source: '<index:><div class="box" as="__proto__"></div>'
      };
      Box.prototype.create = function() {
        this.boxElement.className = 'box-changed-in-create';
      };
      var harness = runner.createHarness('<view is="box" />', Box);
      expect(harness).to.render('<div class="box"></div>');
});

When as attribute is controlled by attackers, the variable in this.lastSegment will exactly take value __proto__ and prototype pollution happens.

Impact

Affected versions

derby (<= 2.3.1) derby (>= 3.0.0, <= 3.0.1) derby (>= 4.0.0-beta1, <= 4.0.0-beta.10)

Security releases

derby → 2.3.2 (npm) derby → 3.0.2 (npm) derby → 4.0.0-beta.11 (npm)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

Add a check on this.lastSegment can prevent this attack.

emit(context: Context, target: T) {
  const node = traverseAndCreate(context.controller, this.segments);
+  if (this.lastSegment.includes('__proto__') || this.lastSegment.includes('prototype')) {
+    throw new Error('Unsafe code detected');
+  }
    node[this.lastSegment] = target;
    this.addListeners(target, node, this.lastSegment);
}

Frequently Asked Questions

  1. What is GHSA-82JV-9WJW-PQH6? GHSA-82JV-9WJW-PQH6 is a low-severity security vulnerability in derby (npm), affecting versions <= 2.3.1. It is fixed in 2.3.2, 3.0.2, 4.0.0-beta.11.
  2. Which versions of derby are affected by GHSA-82JV-9WJW-PQH6? derby (npm) versions <= 2.3.1 is affected.
  3. Is there a fix for GHSA-82JV-9WJW-PQH6? Yes. GHSA-82JV-9WJW-PQH6 is fixed in 2.3.2, 3.0.2, 4.0.0-beta.11. Upgrade to this version or later.
  4. Is GHSA-82JV-9WJW-PQH6 exploitable, and should I be worried? Whether GHSA-82JV-9WJW-PQH6 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  5. What actually determines whether GHSA-82JV-9WJW-PQH6 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  6. How do I fix GHSA-82JV-9WJW-PQH6?
    • Upgrade derby to 2.3.2 or later
    • Upgrade derby to 3.0.2 or later
    • Upgrade derby to 4.0.0-beta.11 or later

Stop the waste.
Protect your environment with Kodem.