GHSA-qj3p-xc97-xw74: @metamask/sdk MetaMask SDK Indirectly Exposed Vulnerability

MODERATE
CWE-506
Published
Advisory Summary

GHSA-qj3p-xc97-xw74 is a MODERATE metamask sdk indirectly exposed vulnerability (CWE-506: Embedded Malicious Code) affecting @metamask/sdk libraries in the npm ecosystem. The issue involves metamask sdk indirectly exposed via malicious debug@4.4.2 dependency. Remediation is available by upgrading affected packages to version 0.33.1.

GHSA-qj3p-xc97-xw74 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-qj3p-xc97-xw74
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-506: Embedded Malicious Code
Affected Product @metamask/sdk
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-qj3p-xc97-xw74

To remediate this vulnerability, upgrade all affected @metamask/sdk dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@metamask/sdk fixed: 0.33.1
npm install @metamask/sdk@0.33.1
@metamask/sdk-react fixed: 0.33.1
npm install @metamask/sdk-react@0.33.1
@metamask/sdk-communication-layer fixed: 0.33.1
npm install @metamask/sdk-communication-layer@0.33.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @metamask/sdk

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-qj3p-xc97-xw74, inspect your project dependencies using npm:

npm ls @metamask/sdk

Analyze the terminal output to locate any version of @metamask/sdk in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.33.1), your application is affected.

Note: The npm ls @metamask/sdk command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-506: Embedded Malicious Code, where the product contains code that appears to be malicious in nature. In @metamask/sdk, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Who is affected? This advisory only applies to developers who use MetaMask SDK in the browser and who, on Sept 8th 2025 between 13:00–15:30 UTC, performed one of the following actions and then deployed their application: - Installed MetaMask SDK into a project with a lockfile for the first time - Installed MetaMask SDK in a project without a lockfile - Updated a lockfile to pull in `debug@4.4.2` (e.g., via `npm update` or `yarn upgrade`) ### What happened? On Sept 8th, 2025 (13:00–15:30 UTC), a malicious version of the `debug` package (v4.4.2) was published to npm. The injected code attempts to interfere with dApp-to-wallet communication when executed in a browser context. While MetaMask SDK itself was not directly impacted, projects installing the SDK during this window may have inadvertently pulled in the malicious version of `debug`. ### Mitigation - If your application was rebuilt and redeployed after Sept 8th, 2025, 15:30 UTC, the malicious version of debug should no longer be present. Please also verify that your package manager (npm, yarn, pnpm, etc.) is not caching `debug@4.4.2`. - If you have not yet deployed since performing one of the actions above, delete your `node_modules` and reinstall dependencies before deploying. - If your application was deployed during the attack window and has not been rebuilt since, perform a clean install of dependencies and redeploy to ensure the malicious package is removed. ### Resources [GitHub Advisory for debug](https://github.com/advisories/GHSA-8mgj-vmr8-frr6)

GHSA-qj3p-xc97-xw74 Affected @metamask/sdk Versions

3 component(s)
Fixed Versions:
0.33.1
Product / Package Ecosystem Affected Versions Fixed Version
@metamask/sdk
npm
≥ 0.16.0
< 0.33.1
0.33.1
@metamask/sdk-react
npm
≥ 0.16.0
< 0.33.1
0.33.1
@metamask/sdk-communication-layer
npm
≥ 0.16.0
< 0.33.1
0.33.1

References

Frequently Asked Questions

What is GHSA-qj3p-xc97-xw74?
GHSA-qj3p-xc97-xw74 is a security vulnerability in @metamask/sdk involving MetaMask SDK indirectly exposed via malicious debug@4.4.2 dependency under CWE-506: Embedded Malicious Code.
Which @metamask/sdk versions are affected?
Affected versions include releases prior to 0.33.1 across affected packages: @metamask/sdk, @metamask/sdk-react, @metamask/sdk-communication-layer.
What version fixes GHSA-qj3p-xc97-xw74?
Upgrading to 0.33.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @metamask/sdk affected?
Yes, @metamask/sdk is affected in releases prior to 0.33.1. Upgrade your dependency to 0.33.1 or later.
Is @metamask/sdk-react affected?
Yes, @metamask/sdk-react is affected in releases prior to 0.33.1. Upgrade your dependency to 0.33.1 or later.
What CWE is associated with GHSA-qj3p-xc97-xw74?
GHSA-qj3p-xc97-xw74 is classified under CWE-506: Embedded Malicious Code (The product contains code that appears to be malicious in nature.).
How can I check npm dependencies for GHSA-qj3p-xc97-xw74?
Run the dependency tree command: 'npm ls @metamask/sdk'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-qj3p-xc97-xw74",
  "modified" : "2025-09-15T13:55:56Z",
  "published" : "2025-09-15T13:55:56Z",
  "aliases" : [ ],
  "summary" : "MetaMask SDK indirectly exposed via malicious debug@4.4.2 dependency",
  "details" : "### Who is affected?\nThis advisory only applies to developers who use MetaMask SDK in the browser and who, on Sept 8th 2025 between 13:00–15:30 UTC, performed one of the following actions and then deployed their application:\n- Installed MetaMask SDK into a project with a lockfile for the first time\n- Installed MetaMask SDK in a project without a lockfile\n- Updated a lockfile to pull in `debug@4.4.2` (e.g., via `npm update` or `yarn upgrade`)\n\n### What happened?\nOn Sept 8th, 2025 (13:00–15:30 UTC), a malicious version of the `debug` package (v4.4.2) was published to npm. The injected code attempts to interfere with dApp-to-wallet communication when executed in a browser context. \n\nWhile MetaMask SDK itself was not directly impacted, projects installing the SDK during this window may have inadvertently pulled in the malicious version of `debug`.\n\n### Mitigation\n- If your application was rebuilt and redeployed after Sept 8th, 2025, 15:30 UTC, the malicious version of debug should no longer be present. Please also verify that your package manager (npm, yarn, pnpm, etc.) is not caching `debug@4.4.2`.\n- If you have not yet deployed since performing one of the actions above, delete your `node_modules` and reinstall dependencies before deploying.\n- If your application was deployed during the attack window and has not been rebuilt since, perform a clean install of dependencies and redeploy to ensure the malicious package is removed.\n\n### Resources\n[GitHub Advisory for debug](https://github.com/advisories/GHSA-8mgj-vmr8-frr6)",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@metamask/sdk"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.16.0"
      }, {
        "fixed" : "0.33.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.33.0"
    }
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@metamask/sdk-react"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.16.0"
      }, {
        "fixed" : "0.33.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.33.0"
    }
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@metamask/sdk-communication-layer"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.16.0"
      }, {
        "fixed" : "0.33.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.33.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/MetaMask/metamask-sdk/security/advisories/GHSA-qj3p-xc97-xw74"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/MetaMask/metamask-sdk/pull/1342"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/MetaMask/metamask-sdk/commit/baa185c6cfa97755a3d389d956372ad9eb37c4a4"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/MetaMask/metamask-sdk"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-506" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-09-15T13:55:56Z",
    "nvd_published_at" : null
  }
}