CVE-2021-32662: Backstage TechDocs path traversal in mkdocs.yml

CVE-2021-32662 · Severity: low · CVSS 3.1 · Published 2021-06-04

Backstage TechDocs is a documentation hosting platform used to manage and publish technical documentation. A path traversal vulnerability allows an attacker with access to modify the project's mkdocs.yml configuration file to read arbitrary sensitive files from the build environment, exposing them via the TechDocs API. This could lead to exposure of credentials, private keys, or other confidential data stored alongside documentation sources.

Technologies: Backstage TechDocs, @backstage/techdocs-common (npm). Vendors: Backstage, npm.

Quick answers

Is CVE-2021-32662 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2021-32662 being exploited in the wild.
How severe is CVE-2021-32662?
Low severity, with a CVSS score of 3.1, published 4 June 2021.
Which products and versions are affected?
Backstage TechDocs < 0.6.5; @backstage/techdocs-common (npm) SEMVER:introduced=0,fixed=0.6.3.
Is there a fix for CVE-2021-32662?
Yes. @backstage/techdocs-common (npm): upgrade to 0.6.3 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2021-32662 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2021-32662?
Check whether you run Backstage TechDocs or @backstage/techdocs-common (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • @backstage/techdocs-common (npm): upgrade to 0.6.3 or later
    npm install @backstage/techdocs-common@0.6.3

Technical details

The vulnerability is a classic path traversal (CWE-22) in the TechDocs documentation builder. By setting a malicious docs_dir path in mkdocs.yml, an attacker can traverse outside the intended documentation directory and access arbitrary files on the build system. The vulnerability requires two preconditions: (1) the attacker must have write access to the mkdocs.yml configuration in the documentation source repository, and (2) they must be able to access the TechDocs backend API to retrieve the exposed files. The patched version 0.6.3 (later updated to 0.6.5) of @backstage/techdocs-common properly sanitizes the docs_dir path to prevent traversal attacks.

Affected products

  • Backstage TechDocs < 0.6.5

Identifiers

  • CVE-2021-32662
  • GHSA-pgf8-28gg-vpr6

Timeline

  • 2021-06-03: disclosed
  • 2021-06-03: patched: Patched in version 0.6.3/0.6.5 of @backstage/techdocs-common

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.