/

CVE-2026-24046

Severity:

HIGH RISK

(7.1)

Path Traversal / Symlink Attack in Backstage Scaffolder and

CVE-2026-24046

Deferred

Vulnerability type

Category:

Path Traversal / Symlink Attack

CWE:

CWE-22, CWE-59

Impact:

Arbitrary File Read/Write/Delete Outside Intended Directory

Severity:

HIGH RISK

(7.1)

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

Multiple Scaffolder actions and archive extraction utilities in Backstage were vulnerable to symlink-based path traversal, allowing operations to escape the intended workspace directory.

When an attacker can create and execute Scaffolder templates, they can abuse symlinks to read, delete, or write files outside the workspace, potentially exposing configuration files, system data, or secrets.

Affected context

This vulnerability affects Backstage deployments that:

  • Use the Scaffolder functionality for templated automation, and
  • Allow users (developers, CI agents, or integrations) to create or execute Scaffolder templates, and
  • Rely on filesystem operations that are expected to be confined to a workspace directory.

The issue appears when filesystem operations (logging, deletion, archive extraction) follow attacker-controlled symlinks without enforcing directory boundaries or performing robust path validation.

Exploit preconditions

  • Attack surface: Backstage Scaffolder actions and archive extraction utilities.
  • Required access: Ability to:
  • Create or modify Scaffolder templates, or
  • Trigger execution of templates that consume attacker-controlled archive content or file paths.
  • Trigger points:
  • debug:log (or similar) reading files that may be symlink targets.
  • fs:delete deleting files in locations derived from paths that may include symlinks.
  • Tar/zip extraction into the workspace where archives contain malicious symlinks pointing outside the workspace.
  • Why exploitation is possible:
  • Filesystem operations implicitly trust the resolved paths and do not verify that the effective target remains within the intended workspace directory.
  • Symlinks created by or included in attacker-controlled inputs are followed by the runtime, enabling traversal outside the allowed directory scope.

Why this happens

The root cause lies in insufficient validation of file paths and symlink behavior before performing filesystem operations, mapping directly to:

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), and
  • CWE-59: Improper Link Resolution Before File Access ('Link Following').

The implementation assumes that operations will remain inside a designated workspace, but it uses general-purpose filesystem APIs that transparently resolve symlinks.

Without explicitly resolving and checking canonical paths against an allowed base directory, symlinks in attacker-controlled locations (templates or archives) can point outside the workspace.

As a result, read, write, and delete operations can be redirected to unintended parts of the filesystem.

Potential impact

  • Reading arbitrary files that the Backstage process can access (e.g., /etc/passwd, configuration files, API keys, or other secrets).
  • Deleting arbitrary files outside the intended workspace, potentially causing service disruption or data loss.
  • Writing or overwriting files outside the workspace via archive extraction, which could lead to configuration tampering or introduction of malicious files.
  • Leveraging file write capabilities to influence other services on the host (e.g., modifying config files, scripts, or data consumed by separate processes), depending on deployment and permissions.

General mitigation guidance

Effective mitigation focuses on enforcing strict filesystem boundaries and minimizing the trust placed in template and archive content:

  • Enforce directory confinement:
  • Resolve all file paths to their canonical (real) paths before use and verify they are descendants of a configured workspace or sandbox directory.
  • Reject operations where the resolved path escapes the allowed base directory.
  • Harden symlink handling:
  • Explicitly disallow or sanitize symlinks in workspace directories that are influenced by user-controlled inputs (including template-generated content and extracted archives).
  • Use extraction routines that support symlink-aware security checks (e.g., skipping symlinks or validating their targets).
  • Apply least-privilege filesystem access:
  • Run Backstage components under a dedicated account with the minimum filesystem permissions required for their function.
  • In containerized deployments, restrict host mounts and expose only the directories that are strictly necessary.
  • Constrain Scaffolder capabilities:
  • Treat the ability to create or modify templates as a privileged operation, only granted to trusted users or tightly controlled automation.
  • Restrict which actions and parameters can be used in templates, especially those that perform file operations.
  • Defense-in-depth controls:
  • Consider read-only mounts for sensitive configuration and system paths when compatible with your deployment model.
  • Segregate high-value secrets and configuration data into dedicated, well-guarded stores rather than filesystem files accessible to application code.

How teams detect issues like this

Detection and assurance can leverage both code-level and operational techniques:

  • Static analysis and code review:
  • Search for filesystem operations that:
  • Use user- or template-controlled paths, and
  • Do not perform canonical path resolution and base-directory checks.
  • Look for generic tar/zip extraction utilities that do not explicitly handle symlinks or validate extracted paths.
  • Flag patterns where actions (like debug:log, fs:delete, or custom file utilities) operate directly on template-supplied paths.
  • Policy and configuration review:
  • Review Scaffolder templates for use of symlinks or for operations that can indirectly manipulate paths (e.g., archives, path concatenation, "debug" utilities).
  • Audit permissions configuration to identify roles that can create or execute templates with file system side effects.
  • Runtime monitoring:
  • Monitor application logs and host auditing tools for file operations by the Backstage process outside expected workspace directories.
  • Use host-based intrusion detection or container security tools to detect anomalous file access patterns and symlink-following behavior.
  • Automated tooling:
  • Integrate security linters or SAST tools that recognize path traversal and symlink-following anti-patterns in Node.js/TypeScript codebases.
  • Periodically scan templates and build artifacts for unsafe filesystem usage as part of CI/CD pipelines.

Sources

SourceLink
github.comgithub.com/backstage/backstage/commit/c641c147ab371a9a8a2f5f67fdb7cb9c97ef345d
github.comgithub.com/backstage/backstage/security/advisories/GHSA-rq6q-wr2q-7pgp
access.redhat.comaccess.redhat.com/errata/RHSA-2026:6174
access.redhat.comaccess.redhat.com/errata/RHSA-2026:6802
access.redhat.comaccess.redhat.com/security/cve/CVE-2026-24046
bugzilla.redhat.combugzilla.redhat.com/show_bug.cgi?id=2431878
security.access.redhat.comsecurity.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-24046.json

Frequently asked

questions

Exploitation is typically remote in nature: an attacker interacts with Backstage over the network. However, they must have sufficient permissions within Backstage to create or execute Scaffolder templates or otherwise control inputs used by file operations.

The attacker must be able to:

  • Create or modify templates that invoke vulnerable actions (such as logging, deleting, or extracting files), or
  • Trigger existing templates that consume attacker-controlled archives or file paths.

In most deployments, this corresponds to a developer or system-integrator role, not an unauthenticated external user.

The most robust fix is to enforce strict directory boundaries by resolving paths and confirming they stay within a designated workspace, combined with explicit handling or outright rejection of symlinks in any attacker-influenced location. This pattern should be applied consistently across all file operations—reads, writes, deletes, and archive extraction.

To prevent future occurrences:

  • Design file-handling code under the assumption that paths and archives can be malicious, and always validate resolved paths against an allowed base directory.
  • Adopt coding standards that disallow unvalidated path usage and require symlink-aware logic in filesystem utilities.
  • Restrict template authoring and execution privileges, and periodically review templates for operations that access the filesystem.
  • Combine secure coding practices with automated checks (SAST, linters) and environment hardening (least privilege, sandboxing) to catch regressions early.
Find out what's already
exploitable in your codebase.