Prototype pollution in jQuery's deep extend, affecting Drupal and Backdrop CMS

Note: This data is for reference and cybersecurity research purposes only.CyStack advises users not to use this information for unlawful purposes.

Overview

Original source data

jQuery before 3.4.0, as used in Drupal, Backdrop CMS, and other products, mishandles jQuery.extend(true, {},...) because of Object.prototype pollution. If an unsanitized source object contained an enumerable proto property, it could extend the native Object.prototype.

Affected products and scope

Every jQuery release issued before the fixed version is affected. The record also names Drupal, Backdrop CMS, Debian, Fedora, openSUSE backports and Leap, NetApp OnCommand System Manager and SnapCenter, Red Hat CloudForms and Virtualization Manager, and a long list of Oracle products that embed or ship the library. Anything that bundles jQuery, including applications that vendor their JavaScript dependencies, should be checked rather than assumed clean. The record does not describe configurations that are exempt.

Technical details

The weakness is prototype pollution in jQuery's deep merge. jQuery.extend(true, {},...) copies properties from a source object into a target recursively when the first argument is true, so nested objects are merged rather than replaced. If a source object that has not been sanitised contains an enumerable proto property, the merge walks into it and writes onto the native Object.prototype rather than onto a property of the target. Once written, the property is inherited by every object created in that JavaScript environment. The record attributes the flaw to how jQuery handles that merge and notes that Drupal, Backdrop CMS and other products embed the affected library. No further mechanism detail is given in the record.

Exploitability

The record scores this as reachable over the network with low complexity and no privileges required, but with user interaction required: the vulnerable merge has to run with attacker-influenced data, typically while a victim loads or uses the affected page. Public exploit code exists for this issue. The record does not list it as known to be exploited in the wild, so confirmed campaign use is not established here, while the availability of public techniques makes it a realistic thing to test for.

Technical impact

An attacker gains the ability to set properties on Object.prototype inside a victim's JavaScript context, which can change the behaviour of application code that reads configuration or options from ordinary objects. Scope is recorded as changed, meaning the effect can cross from the vulnerable component into the surrounding application. The record does not describe direct code execution being achieved through this issue, and availability impact is recorded as none. The practical ceiling depends entirely on what the application does with the polluted properties, which varies by product and is not detailed in the record.

Business impact

An attacker who can get data into a deep merge call can change how the application's JavaScript behaves for other users, which affects integrity of what pages render and can expose limited information. For a Drupal or Backdrop site, or any product that embeds the library, that reaches the browser sessions of ordinary visitors and editors, not just the attacker. The likely costs are defacement or manipulated page content, tampering with client-side checks, and the clean-up and trust damage that follows when users see a site behaving in ways its owners did not intend. The record rates confidentiality and integrity impact as low and availability as unaffected, so this is not a site-takeover bug on its own. Teams that maintain public-facing web properties, and anyone tracking third-party JavaScript dependencies, should care.

Remediation

Update the jQuery copy used by your application to a release at or after the fixed version, and ship that change through your normal asset pipeline, since cached bundles can keep an old copy alive in browsers. Apply the Drupal and Backdrop CMS security releases if you run those products, and the distribution packages if jQuery comes from the operating system. Where a component cannot be updated promptly, stop passing untrusted objects into deep extend calls: build the source object from an explicit allowlist of keys and reject input containing proto. Treat any application that merges user-controlled JSON into configuration objects as needing review.

Detection

Inventory the jQuery version in every deployed bundle, including vendored copies inside themes, modules and third-party components, because the top-level dependency often does not reflect what is actually served. Search client and server code for deep extend calls whose source object comes from a request, a stored document, or parsed JSON. On the network side, look for request bodies or query strings containing proto reaching endpoints that build objects from user input, and watch for unexpected changes in rendered page content or client-side errors following such requests.

Sources (80)
mitre (CNA)
lists.apache.org
Learn more

Run an in-depth assessment with complete web risk management

CyStack VulnScan continuously discovers assets, validates vulnerabilities, and helps security teams prioritize remediation across the organization.