Vulnerabilities in pkg:npm/gatsby-source-wordpress

PACKAGE
Advisory Identifier: GHSA-rqjw-p5vr-c695
Advisory Summary

CVE-2021-32770 is a HIGH (CVSS 7.5) remote code execution vulnerability (CWE-522: Insufficiently Protected Credentials) affecting Gatsby source wordpress libraries in the npm ecosystem. The issue involves basic-auth app bundle credential exposure in gatsby-source-wordpress. Remediation is available by upgrading affected packages to version 4.0.8, 5.9.2.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/gatsby-source-wordpress

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/gatsby-source-wordpress. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-rqjw-p5vr-c695 CVE-2021-32770 HIGH Basic-auth app bundle credential exposure in gatsby-source-wordpress

CVE-2021-32770 at a Glance

CVE Identifier CVE-2021-32770
GHSA Identifier GHSA-rqjw-p5vr-c695
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-522: Insufficiently Protected Credentials
Affected Product Gatsby source wordpress
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2021-32770

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

gatsby-source-wordpress fixed: 4.0.8
npm install gatsby-source-wordpress@4.0.8
gatsby-source-wordpress fixed: 5.9.2
npm install gatsby-source-wordpress@5.9.2
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 gatsby-source-wordpress

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2021-32770, inspect your project dependencies using npm:

npm ls gatsby-source-wordpress

Analyze the terminal output to locate any version of Gatsby source wordpress in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.0.8), your application is affected.

Note: The npm ls gatsby-source-wordpress 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-522: Insufficiently Protected Credentials, where the product transmits or stores authentication credentials, but it uses an insecure method that is susceptible to unauthorized interception and/or retrieval. In Gatsby source wordpress, 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

### Impact The gatsby-source-wordpress plugin prior to versions 4.0.8 and 5.9.2 leaks .htaccess HTTP Basic Authentication variables into the app.js bundle during build-time. Users who are not initializing basic authentication credentials in the gatsby-config.js are not affected. Example affected gatsby-config.js: ``` resolve: 'gatsby-source-wordpress', auth: { htaccess: { username: leaked_username password: leaked_password, }, }, ``` ### Patches A patch has been introduced in gatsby-source-wordpress@4.0.8 and gatsby-source-wordpress@5.9.2 which mitigates the issue by filtering all variables specified in the `auth: { }` section. Users that depend on this functionality are advised to upgrade to the latest release of gatsby-source-wordpress, run `gatsby clean` followed by a `gatsby build`. ### Workarounds There is no known workaround at this time, other than manually editing the app.js file post-build. ### For more information Email us at [security@gatsbyjs.com](mailto:security@gatsbyjs.com)

CVE-2021-32770 Affected Gatsby source wordpress Versions

2 component(s)
Fixed Versions:
4.0.85.9.2
Product / Package Ecosystem Affected Versions Fixed Version
gatsby-source-wordpress
npm
< 4.0.8
4.0.8
gatsby-source-wordpress
npm
≥ 5.0.0
< 5.9.2
5.9.2

References

Frequently Asked Questions

What is CVE-2021-32770?
CVE-2021-32770 is a security vulnerability in Gatsby source wordpress involving Basic-auth app bundle credential exposure in gatsby-source-wordpress under CWE-522: Insufficiently Protected Credentials.
Which Gatsby source wordpress versions are affected?
Affected versions include releases prior to 4.0.8, 5.9.2 across affected packages: gatsby-source-wordpress.
What version fixes CVE-2021-32770?
Upgrading to 4.0.8, 5.9.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is gatsby-source-wordpress affected?
Yes, gatsby-source-wordpress is affected in releases prior to 4.0.8, 5.9.2. Upgrade your dependency to 4.0.8, 5.9.2 or later.
What is the CVSS score of CVE-2021-32770?
CVE-2021-32770 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2021-32770?
CVE-2021-32770 is classified under CWE-522: Insufficiently Protected Credentials (The product transmits or stores authentication credentials, but it uses an insecure method that is susceptible to unauthorized interception and/or retrieval.).
How can I check npm dependencies for CVE-2021-32770?
Run the dependency tree command: 'npm ls gatsby-source-wordpress'. 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-rqjw-p5vr-c695",
  "modified" : "2021-07-28T15:18:01Z",
  "published" : "2021-07-19T15:21:41Z",
  "aliases" : [ "CVE-2021-32770" ],
  "summary" : "Basic-auth app bundle credential exposure in gatsby-source-wordpress",
  "details" : "### Impact\nThe gatsby-source-wordpress plugin prior to versions 4.0.8 and 5.9.2 leaks .htaccess HTTP Basic Authentication variables into the app.js bundle during build-time.  Users who are not initializing basic authentication credentials in the gatsby-config.js are not affected.\n\nExample affected gatsby-config.js:\n```\n      resolve: 'gatsby-source-wordpress',\n        auth: {\n          htaccess: {\n            username: leaked_username\n            password: leaked_password,\n          },\n        },\n```\n\n### Patches\nA patch has been introduced in gatsby-source-wordpress@4.0.8 and gatsby-source-wordpress@5.9.2 which mitigates the issue by filtering all variables specified in the `auth: { }` section.  Users that depend on this functionality are advised to upgrade to the latest release of gatsby-source-wordpress, run `gatsby clean` followed by a `gatsby build`.\n\n\n### Workarounds\nThere is no known workaround at this time, other than manually editing the app.js file post-build.\n\n\n### For more information\nEmail us at [security@gatsbyjs.com](mailto:security@gatsbyjs.com)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "gatsby-source-wordpress"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.0.8"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "gatsby-source-wordpress"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0"
      }, {
        "fixed" : "5.9.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/gatsbyjs/gatsby/security/advisories/GHSA-rqjw-p5vr-c695"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-32770"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200", "CWE-522" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-07-15T20:28:20Z",
    "nvd_published_at" : "2021-07-15T19:15:00Z"
  }
}