/

CVE-2026-29186

Severity:

HIGH RISK

(7.7)

Configuration Injection / Code Execution via Unsafe

CVE-2026-29186

Modified

Vulnerability type

Category:

Configuration Injection / Code Execution via Unsafe Configuration Handling

CWE:

CWE-74, CWE-434, CWE-791

Impact:

Arbitrary Code Execution during Documentation Build

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 contained a configuration bypass that allowed attackers to craft malicious mkdocs.yml files which escaped the intended allowlist of safe options.

Under certain deployment setups where untrusted users can influence TechDocs documentation sources, this gap in configuration filtering could enable arbitrary Python code execution during the MkDocs build process.

Affected context

This vulnerability appears in Backstage deployments using the @backstage/plugin-techdocs-node package to build documentation with MkDocs.

It is relevant when:

  • Documentation sources (including mkdocs.yml) can be modified by users or automated systems not fully trusted, and
  • TechDocs runs MkDocs builds on server-side infrastructure (CI runners, internal build services, or Backstage-hosted build agents).

The issue arises because TechDocs relies on an allowlist of "safe" MkDocs configuration keys, but a gap in that allowlist still permits configuration-driven execution paths inside MkDocs.

Exploit preconditions

  • Attack surface: The TechDocs documentation pipeline that processes mkdocs.yml and associated content.
  • Required access: Ability to introduce or modify mkdocs.yml in a project that TechDocs builds (e.g., via a Git repository, docs source repo, or connected SCM system).
  • Trigger point: Initiation of a TechDocs build that uses the crafted mkdocs.yml, such as viewing docs that trigger a build, or scheduled/CI-based documentation generation.
  • Why exploitation is possible: TechDocs implements an allowlist to restrict dangerous MkDocs options, but the list is incomplete. MkDocs can be configured (via overlooked keys or structures) to load or execute Python code during the build, allowing attackers to bypass TechDocs' security controls.

Why this happens

The root cause is an incomplete configuration allowlist that attempts to neutralize dangerous MkDocs options without fully modeling all execution-capable configurations.

This maps to CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component, because user-controlled configuration is passed to MkDocs, a downstream component capable of executing Python code, without comprehensive sanitization.

There is also an aspect of CWE-434: Unrestricted Upload of File with Dangerous Type at the configuration level: mkdocs.yml—treated as harmless project metadata—can in practice direct MkDocs to load and execute dangerous code or plugins.

Conceptually, this is a policy enforcement gap: the security boundary is defined in configuration, but the filter is too narrow and fails to cover all code-execution vectors available in MkDocs' configuration surface.

Potential impact

  • Attackers could cause execution of arbitrary Python code within the TechDocs build environment.
  • Compromise of the host running TechDocs builds, including potential access to environment variables, credentials, or local files accessible to the build process.
  • Lateral movement within the internal network if the build environment has outbound access or additional privileges.
  • Tampering with generated documentation, including injecting malicious content or misleading operational guidance.
  • Use of the build environment as a pivot for supply-chain attacks (e.g., modifying artifacts, tokens, or build outputs used by other systems).

General mitigation guidance

Mitigation is best approached by hardening configuration handling and reducing the trust placed in documentation inputs.

Recommended defensive patterns include:

  • Prefer secure-by-default integration patterns with MkDocs: disable or tightly restrict dynamic features such as arbitrary plugins, Python hooks, and shell commands when running in multi-tenant or partially trusted environments.
  • Move from an "allowlist-by-best-effort" model to strict schema-based validation for mkdocs.yml, defining precisely which keys, types, and values are permitted, and rejecting everything else.
  • Isolate the documentation build process using sandboxing and least privilege: run builds in containers or restricted workers with limited filesystem, network access, and no access to sensitive secrets.
  • Treat mkdocs.yml and documentation content as untrusted input, even if sourced from internal repositories; apply the same security posture used for user-generated content.
  • Implement defense-in-depth: combine configuration validation with OS-level restrictions (e.g., seccomp, AppArmor, or similar) on the build environment to make code execution paths less useful to an attacker.

How teams detect issues like this

Effective detection focuses on identifying risky configuration handling as well as suspicious build-time behavior:

  • Static analysis and code review:
  • Flag code paths that pass user-controlled configuration structures directly into MkDocs or other documentation engines.
  • Highlight allowlist-based filters that lack comprehensive schema enforcement, especially for tools known to support plugins or code execution.
  • Look for plugin loading, Python hooks, or shell command invocation options in MkDocs integration code.
  • Policy enforcement and CI checks:
  • Enforce policies that disallow certain MkDocs features or plugins within mkdocs.yml (e.g., blocklisted keys or patterns) as part of pre-merge checks.
  • Use configuration linters that validate mkdocs.yml files against a safe schema.
  • Runtime and operational monitoring:
  • Monitor TechDocs build workers for unusual process activity, outbound network connections, or access to sensitive paths during documentation builds.
  • Log and periodically review mkdocs.yml content and build metadata for unexpected configuration keys or plugin references.
  • Automated security tooling can help identify direct uses of MkDocs APIs and configuration ingestion points, but should be complemented with manual review of the security model for documentation builds.

Sources

SourceLink
github.comgithub.com/backstage/backstage/security/advisories/GHSA-928r-fm4v-mvrw
access.redhat.comaccess.redhat.com/errata/RHSA-2026:13826
access.redhat.comaccess.redhat.com/errata/RHSA-2026:9742
access.redhat.comaccess.redhat.com/security/cve/CVE-2026-29186
bugzilla.redhat.combugzilla.redhat.com/show_bug.cgi?id=2445480
security.access.redhat.comsecurity.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-29186.json

Frequently asked

questions

It can be, depending on how TechDocs is connected to documentation sources. If an attacker can push changes to a repository or documentation source that TechDocs builds—such as through a compromised developer account or a public-facing contribution flow—then they may trigger arbitrary code execution during the build without direct access to the Backstage host.

The attacker needs the ability to influence or control mkdocs.yml (and potentially related documentation files) for a project that TechDocs will build. This is often equivalent to write access to a source code repository or documentation repo integrated with Backstage. No direct shell access to the Backstage server is required.

The strongest fix is to treat mkdocs.yml as untrusted data and enforce a strict, minimal schema that only permits configurations known to be safe. Combined with disabling or tightly restricting dynamic features and plugins, and running MkDocs in a sandboxed, least-privilege environment, this drastically reduces the risk of configuration-driven code execution.

Preventing similar vulnerabilities requires designing integrations with external tools under a clear threat model: assume configuration and content may be hostile. Use schema validation instead of ad-hoc allowlists, minimize enabled features in third-party tools, run build and rendering processes in isolated environments, and continuously review integrations whenever upstream tools add new configuration options or execution paths.

Find out what's already
exploitable in your codebase.