/

CVE-2026-106509

Severity:

HIGH RISK

(7.7)

Code Injection (CWE-94) in Backstage TechDocs Build

CVE-2026-106509

Analyzed

Vulnerability type

Category:

Code Injection

CWE:

CWE-94, CWE-1336

Impact:

Arbitrary Code Execution

Severity:

HIGH RISK

(7.7)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Backstage TechDocs contains improper validation of MkDocs theme configuration values during local or containerized documentation builds. A user with write access to a registered repository may be able to place crafted configuration in mkdocs.yml, potentially causing arbitrary code execution in the documentation build environment.

Backstage TechDocs contains improper validation of MkDocs theme configuration values during local or containerized documentation builds. A user with write access to a registered repository may be able to place crafted configuration in mkdocs.yml, potentially causing arbitrary code execution in the documentation build environment.

Affected context

The issue may occur in Backstage deployments that:

  • Use the @backstage/plugin-techdocs-node package
  • Build TechDocs locally or inside a container
  • Process mkdocs.yml files from registered repositories
  • Permit repository contributors to modify documentation configuration

Risk depends on the permissions available to the documentation build process and the trust placed in repository content.

The issue may occur in Backstage deployments that:

  • Use the @backstage/plugin-techdocs-node package
  • Build TechDocs locally or inside a container
  • Process mkdocs.yml files from registered repositories
  • Permit repository contributors to modify documentation configuration

Risk depends on the permissions available to the documentation build process and the trust placed in repository content.

Exploit preconditions

  • Attack surface: TechDocs documentation build processing
  • Required access: Write access to a repository registered with the Backstage instance
  • Trigger point: Processing MkDocs theme configuration during a local or containerized build
  • Why exploitation is possible: Theme-related configuration values are insufficiently validated before being interpreted by the build process, allowing repository-controlled input to influence executable behavior
  • Attack surface: TechDocs documentation build processing
  • Required access: Write access to a repository registered with the Backstage instance
  • Trigger point: Processing MkDocs theme configuration during a local or containerized build
  • Why exploitation is possible: Theme-related configuration values are insufficiently validated before being interpreted by the build process, allowing repository-controlled input to influence executable behavior

Why this happens

The underlying bug is improper validation of configuration data that can affect code-generating or code-executing behavior during documentation rendering.

Repository-controlled MkDocs theme values are treated as trusted configuration without adequately restricting their structure or semantics. This maps primarily to CWE-94: Improper Control of Generation of Code, with CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine also relevant when configuration is interpreted through templating or rendering logic.

The underlying bug is improper validation of configuration data that can affect code-generating or code-executing behavior during documentation rendering.

Repository-controlled MkDocs theme values are treated as trusted configuration without adequately restricting their structure or semantics. This maps primarily to CWE-94: Improper Control of Generation of Code, with CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine also relevant when configuration is interpreted through templating or rendering logic.

Potential impact

  • Arbitrary code may execute within the TechDocs build process
  • Build credentials, tokens, or environment data may be exposed
  • Documentation build infrastructure could be compromised
  • Generated documentation or related artifacts could be altered
  • The impact could extend to connected systems if the builder has excessive network or cloud permissions
  • Arbitrary code may execute within the TechDocs build process
  • Build credentials, tokens, or environment data may be exposed
  • Documentation build infrastructure could be compromised
  • Generated documentation or related artifacts could be altered
  • The impact could extend to connected systems if the builder has excessive network or cloud permissions

General mitigation guidance

Mitigation generally focuses on treating repository documentation configuration as untrusted input and preventing configuration values from controlling executable behavior.

Common defensive patterns include:

  • Allowing only documented, schema-constrained theme configuration values
  • Using safe-by-default rendering and templating APIs that do not evaluate user-controlled expressions
  • Separating configuration parsing from any code-generation or execution-capable processing
  • Running documentation builds with least-privilege identities, restricted network access, and minimal filesystem permissions
  • Isolating builds from sensitive credentials and host resources
  • Applying repository trust policies and review requirements to configuration changes

Mitigation generally focuses on treating repository documentation configuration as untrusted input and preventing configuration values from controlling executable behavior.

Common defensive patterns include:

  • Allowing only documented, schema-constrained theme configuration values
  • Using safe-by-default rendering and templating APIs that do not evaluate user-controlled expressions
  • Separating configuration parsing from any code-generation or execution-capable processing
  • Running documentation builds with least-privilege identities, restricted network access, and minimal filesystem permissions
  • Isolating builds from sensitive credentials and host resources
  • Applying repository trust policies and review requirements to configuration changes

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis rules targeting unsafe template evaluation and dynamic code generation in documentation tooling
  • Code review checks for configuration values passed into rendering, plugin, or execution APIs
  • Schema and allowlist validation for MkDocs theme configuration
  • Repository policy checks that flag changes to mkdocs.yml for additional review
  • Runtime monitoring for unexpected child processes, network connections, or filesystem access from TechDocs builders
  • Automated security review tools that identify untrusted configuration reaching code-execution-capable sinks

Organizations can look for this class of issue through:

  • Static analysis rules targeting unsafe template evaluation and dynamic code generation in documentation tooling
  • Code review checks for configuration values passed into rendering, plugin, or execution APIs
  • Schema and allowlist validation for MkDocs theme configuration
  • Repository policy checks that flag changes to mkdocs.yml for additional review
  • Runtime monitoring for unexpected child processes, network connections, or filesystem access from TechDocs builders
  • Automated security review tools that identify untrusted configuration reaching code-execution-capable sinks

Sources

SourceLink
github.comgithub.com/backstage/backstage/commit/02cd7cdbb18b687446277b5602adaee7f1d53cbb
github.comgithub.com/backstage/backstage/commit/a900a9953c8f7ad3ba1906d1d257725a9996cc9d
github.comgithub.com/backstage/backstage/releases/tag/v1.50.5
github.comgithub.com/backstage/backstage/releases/tag/v1.54.6
github.comgithub.com/backstage/backstage/security/advisories/GHSA-8w7q-29mw-gf5c

Frequently asked

questions

It may be exploitable through the normal repository and TechDocs workflow when a user can submit configuration changes to a repository that Backstage builds. Direct network access to the build service is not necessarily required.

The key prerequisite is write access to a repository registered for TechDocs, along with a deployment configuration that builds its documentation locally or in a container.

Treat repository-controlled MkDocs configuration as untrusted, enforce strict allowlist-based validation, and prevent theme or template values from reaching code-execution-capable behavior.

Use safe rendering APIs, isolate documentation builds, minimize builder privileges, review configuration changes, and continuously monitor build processes for unexpected execution or resource access.

It may be exploitable through the normal repository and TechDocs workflow when a user can submit configuration changes to a repository that Backstage builds. Direct network access to the build service is not necessarily required.

The key prerequisite is write access to a repository registered for TechDocs, along with a deployment configuration that builds its documentation locally or in a container.

Treat repository-controlled MkDocs configuration as untrusted, enforce strict allowlist-based validation, and prevent theme or template values from reaching code-execution-capable behavior.

Use safe rendering APIs, isolate documentation builds, minimize builder privileges, review configuration changes, and continuously monitor build processes for unexpected execution or resource access.

Find out what's already
exploitable in your codebase.