Skip to main content
Vulnerability Database/CVE-2026-111172

CVE-2026-111172: @casl/ability Prototype Pollution DoS

CVE-2026-111172 is a prototype pollution flaw in @casl/ability that enables attackers to modify inherited builtins and cause denial of service. This article covers the technical details, affected versions, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-111172 Overview

CVE-2026-111172 is a prototype pollution vulnerability [CWE-1321] in the @casl/ability authorization library for Node.js. Versions 6.7.5 through versions prior to 7.0.2 are affected. The flaw resides in the rulesToFields() helper, which uses an unsafe setByPath routine to assign nested values from dotted condition keys. Attackers who control rule conditions can supply keys such as toString.call to walk the prototype chain and overwrite shared builtin functions process-wide. Successful exploitation causes a denial of service for the entire Node.js process by corrupting inherited builtins.

Critical Impact

Process-wide corruption of JavaScript builtins leading to denial of service for any Node.js application using rulesToFields() with attacker-influenced rule conditions.

Affected Products

  • @casl/ability versions >= 6.7.5 and < 7.0.2
  • Node.js applications consuming rulesToFields() from @casl/ability/extra
  • Downstream frameworks and services that pass user-influenced data into CASL rule conditions

Discovery Timeline

  • 2026-10-15 - CVE CVE-2026-111172 published to NVD
  • 2026-10-16 - Last updated in NVD database

Technical Details for CVE-2026-111172

Vulnerability Analysis

The @casl/ability package provides isomorphic authorization for JavaScript applications. The rulesToFields() helper translates matching rules into a plain object representing permitted field values. Internally, it iterates over condition keys and calls a setByPath utility that splits dotted keys and walks the object graph to assign the final value.

The pre-patch implementation walked keys without validating whether intermediate references were own properties of the target object. When a condition key like toString.call was supplied, setByPath traversed into inherited builtins on Object.prototype, replacing Function.prototype.call or similar functions with attacker-controlled values. Because these builtins are shared across the entire JavaScript runtime, the corruption affects every object in the process. The result is reliable denial of service, since nearly any subsequent operation that triggers the overwritten builtin will throw.

Root Cause

The root cause is unsafe property assignment during nested-path construction in packages/casl-ability/src/utils.ts. The code used res[prop] = res[prop] || {}, which reads through the prototype chain and then writes to the same path. When prop resolved to an inherited function or object, the assignment mutated the prototype rather than creating a null-prototype container on the target. The rulesToFields() return value was also typed as AnyObject, which inherits from Object.prototype, further exposing it to pollution.

Attack Vector

Exploitation requires an attacker to control at least part of the rule conditions passed to a CASL Ability instance that is later consumed by rulesToFields(). Scenarios include rules loaded from a database that stores user-submitted authorization policies, multi-tenant systems where tenants can define field-level restrictions, or any pipeline that forwards unvalidated JSON into CASL rules. The attacker crafts a dotted condition key traversing a builtin (for example toString.call) with a value that is not callable, then triggers any API path that invokes rulesToFields().

typescript
// Patch excerpt from packages/casl-ability/src/utils.ts
// Source: https://github.com/stalniy/casl/commit/58242cb3c7911c8a89bacfb7d732701d81bc1324
    lastKey = keys.pop()!;
    ref = keys.reduce((res, prop) => {
      if (FORBIDDEN_PROPERTIES.has(prop)) return res;
-      res[prop] = res[prop] || {};
+      const value = hasOwn(res, prop) ? res[prop] : undefined;
+      res[prop] = value && typeof value === 'object' && !Array.isArray(value)
+        ? value
+        : Object.create(null);
      return res[prop] as AnyObject;
    }, object);
  }

The fix uses hasOwn() to ignore inherited properties and falls back to Object.create(null), producing containers with no prototype chain to pollute.

typescript
// Patch excerpt from packages/casl-ability/src/extra/rulesToFields.ts
// Source: https://github.com/stalniy/casl/commit/58242cb3c7911c8a89bacfb7d732701d81bc1324
  ability: T,
  action: Parameters<T['rulesFor']>[0],
  subjectType: ExtractSubjectType<Parameters<T['rulesFor']>[1]>,
-): AnyObject {
+): NullObject {
  return ability.rulesFor(action, subjectType)
    .reduce((values, rule) => {
      if (rule.inverted || !rule.conditions) {

The return type was changed to NullObject to ensure the accumulator itself has a null prototype.

Detection Methods for CVE-2026-111172

Indicators of Compromise

  • Node.js processes crashing with TypeError referencing builtin methods such as toString, call, apply, or hasOwnProperty shortly after processing authorization rules
  • Dependency manifests (package.json, package-lock.json, yarn.lock) pinning @casl/ability to a version >= 6.7.5 and < 7.0.2
  • Persisted CASL rule records whose conditions objects contain dotted keys referencing prototype members, for example toString.call or constructor.prototype

Detection Strategies

  • Perform software composition analysis (SCA) across repositories and container images to identify affected @casl/ability versions
  • Add static analysis rules to flag code paths where user-controlled data flows into CASL defineAbility, AbilityBuilder, or stored rule conditions without key allow-listing
  • Review application logs for repeated runtime errors originating in frameworks that call rulesToFields() (for example GraphQL or REST field filters)

Monitoring Recommendations

  • Instrument Node.js services with crash telemetry to surface unexpected process restarts correlated with authorization endpoints
  • Monitor API traffic for request bodies containing suspicious dotted keys such as __proto__, constructor.prototype, or builtin method references
  • Track dependency drift so that upgrades to @casl/ability 7.0.2 or later are enforced across CI/CD pipelines

How to Mitigate CVE-2026-111172

Immediate Actions Required

  • Upgrade @casl/ability to version 7.0.2 or later in all applications and container images
  • Audit any persistence layer that stores CASL rule conditions and remove entries containing dotted keys that reference builtin properties
  • Validate and sanitize user input before it is used to construct CASL rule conditions, rejecting keys with embedded dots unless explicitly allow-listed

Patch Information

The fix is delivered in @casl/ability 7.0.2 via pull request #1305 and commit 58242cb. The patch adds FORBIDDEN_PROPERTIES filtering, uses hasOwn() to skip inherited properties, allocates intermediate containers with Object.create(null), and changes the rulesToFields() return type to NullObject. Full technical details are documented in the VulnCheck advisory.

Workarounds

  • Where immediate upgrade is not possible, wrap calls to rulesToFields() with a validator that rejects condition keys containing ., __proto__, prototype, or constructor
  • Replace the accumulator object passed to downstream consumers with one created via Object.create(null) to limit prototype exposure
  • Restrict the sources of rule conditions to trusted administrators and avoid loading rules directly from end-user input
bash
# Upgrade to the patched release
npm install @casl/ability@^7.0.2

# Verify the installed version across workspaces
npm ls @casl/ability

# Audit for the vulnerable range
npm audit --production

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.