GHSA-mj3g-7xcc-x4vh

Suggest an improvement
Source
https://github.com/advisories/GHSA-mj3g-7xcc-x4vh
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/07/GHSA-mj3g-7xcc-x4vh/GHSA-mj3g-7xcc-x4vh.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-mj3g-7xcc-x4vh
Aliases
Published
2026-07-31T17:49:08Z
Modified
2026-07-31T18:11:48Z
Severity
  • 7.3 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L CVSS Calculator
Summary
@phun-ky/defaults-deep Has a Prototype Pollution issue via Unsafe Recursive Property Merging
Details

Impact

A prototype pollution vulnerability exists in @phun-ky/defaults-deep prior to version 2.0.5.

The library recursively merged user-supplied objects without filtering unsafe property names such as __proto__, constructor, and prototype. An attacker able to supply crafted input could cause properties to be written to Object.prototype, resulting in prototype pollution affecting all objects within the running process.

Applications that pass untrusted input to defaultsDeep() may be impacted. Depending on how the application uses merged objects, this could lead to unexpected behavior, logic bypasses, denial of service, or other security issues.

Patches

This issue has been fixed in version 2.0.5.

Users should upgrade to version 2.0.5 or later.

The fix prevents unsafe prototype-related keys (__proto__, constructor, and prototype) from being processed during recursive merge operations and includes regression tests covering known prototype pollution vectors.

Workarounds

Users unable to upgrade should ensure that untrusted input is sanitized before being passed to defaultsDeep().

At a minimum, applications should reject or remove the following property names from all levels of user-controlled objects:

  • __proto__
  • constructor
  • prototype

Upgrading to a patched version remains the recommended mitigation.

Database specific
{
    "cwe_ids":  [
        "CWE-1321"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-07-31T17:49:08Z",
    "nvd_published_at":  null,
    "severity":  "HIGH"
}
References

Affected packages

npm / @phun-ky/defaults-deep

Package

Name
@phun-ky/defaults-deep
View open source insights on deps.dev
Purl
pkg:npm/%40phun-ky/defaults-deep

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
2.0.5

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/07/GHSA-mj3g-7xcc-x4vh/GHSA-mj3g-7xcc-x4vh.json"