CVE-2021-32660: @backstage/techdocs common Script Injection Vulnerability
MODERATECVE-2021-32660 is a MODERATE (CVSS 6.8) script injection vulnerability (CWE-434: Unrestricted Upload of File with Dangerous Type) affecting @backstage/techdocs common libraries in the npm ecosystem. The issue involves script injection. Remediation is available by upgrading affected packages to version 0.6.4.
CVE-2021-32660 at a Glance
Security Impact
CVSS: 6.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:H).
How to Fix CVE-2021-32660
To remediate this vulnerability, upgrade all affected @backstage/techdocs common dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install @backstage/techdocs-common@0.6.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls @backstage/techdocs-common
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2021-32660, inspect your project dependencies using npm:
npm ls @backstage/techdocs-common
Analyze the terminal output to locate any version of @backstage/techdocs common in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.6.4), your application is affected.
Note: The npm ls @backstage/techdocs-common 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-434: Unrestricted Upload of File with Dangerous Type, where the product allows the upload or transfer of dangerous file types that are automatically processed within its environment. In @backstage/techdocs common, 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
CVE-2021-32660 Affected @backstage/techdocs common Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
@backstage/techdocs-common
|
npm |
< 0.6.4
|
0.6.4
|
References
Frequently Asked Questions
What is CVE-2021-32660?
Which @backstage/techdocs common versions are affected?
What version fixes CVE-2021-32660?
Is @backstage/techdocs-common affected?
What is the CVSS score of CVE-2021-32660?
What CWE is associated with CVE-2021-32660?
How can I check npm dependencies for CVE-2021-32660?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-pwhf-39xg-4rxw",
"modified" : "2021-06-04T19:23:33Z",
"published" : "2021-06-04T19:09:35Z",
"aliases" : [ "CVE-2021-32660" ],
"summary" : "Script injection",
"details" : "### Impact\n\nA malicious internal actor is able to upload documentation content with malicious scripts. These scripts would normally be sanitized by the TechDocs frontend, but by tricking a user to visit the content via the TechDocs API, the content sanitazion will be bypassed. If the TechDocs API is hosted on the same origin as the Backstage app or other backend plugins, this may give access to sensitive data.\n\nThe ability to upload malicious content may be limited by internal code review processes, unless the chosen TechDocs deployment method is to use an object store and the actor has access to upload files directly to that store.\n\n### Patches\n\nThe vulnerability is patched in the `0.6.4` release of `@backstage/techdocs-common`.\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n\n* Open an issue in the [Backstage repository](https://github.com/backstage/backstage)\n* Visit our chat, linked to in [Backstage README](https://github.com/backstage/backstage)",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "@backstage/techdocs-common"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.6.4"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/backstage/backstage/security/advisories/GHSA-pwhf-39xg-4rxw"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-32660"
}, {
"type" : "WEB",
"url" : "https://github.com/backstage/backstage/commit/aad98c544e59369901fe9e0a85f6357644dceb5c"
}, {
"type" : "WEB",
"url" : "https://github.com/backstage/backstage/releases/tag/release-2021-06-03"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-434", "CWE-77" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2021-06-03T22:02:53Z",
"nvd_published_at" : "2021-06-03T17:15:00Z"
}
}