Oct 7, 2026·6 min read·26 visits
Authenticated users can extract raw, unredacted backend-managed credentials from task failure logs and database events generated by failed Backstage Scaffolder workflows.
The @backstage/plugin-scaffolder-backend package prior to version 4.1.0 is vulnerable to sensitive information exposure in Scaffolder task failure events. Under specific template and failure conditions, an authenticated user can retrieve backend-managed credentials, such as VCS access tokens and API keys, from affected task execution events and stored database logs. This vulnerability has been remediated in version 4.1.0 of the package and is bundled with the Backstage platform release v1.54.6.
The Backstage Open-Source Developer Portal Framework provides a Software Templates feature (the Scaffolder) to automate infrastructure provisioning and codebase bootstrap tasks. This functionality is managed by the @backstage/plugin-scaffolder-backend package, which coordinates step-by-step actions like cloning repositories, creating directories, and registering catalog entities.
To perform operations on behalf of users or the organization, the Scaffolder backend requires access to backend-managed secrets. These secrets include personal access tokens (PATs) for version control platforms like GitHub or GitLab, as well as cloud platform access keys.
Prior to version 4.1.0, a vulnerability existed in the error handling and logging paths of the Scaffolder execution engine. Under certain conditions, when a template execution step or persistence checkpoint failed, the backend leaked the secrets used during task execution into the task's failure events. These unredacted events were recorded in the backend database and exposed to authenticated users via the Scaffolder API.
The underlying flaw resides in how the NunjucksWorkflowRunner and the associated Winston logging mechanism managed exceptions. In the event of a step failure, the workflow runner caught the raw error object thrown by the step and serialized it into the database via the taskTrack.markFailed(step, err) method.
Because Node.js Error objects, third-party API client exceptions, and database errors often preserve input parameters within their message or stack trace strings, the unredacted secrets were written directly into the DB. This bypasses the typical stdout/stderr logging layers that might otherwise apply basic masking rules.
Furthermore, several specific design factors exacerbated the leak:
Checkpoint Failures: If checkpoint state updates failed, the system stringified the raw error via stringifyError(err) without invoking log-redaction filters.
AggregateError Traps: When multiple parallel actions or actions combined with checkpoint updates failed, the runtime raised an AggregateError. Native JavaScript AggregateError objects retain their constituent error payloads in an internal .errors array. Standard redaction systems that operate on top-level properties missed these deeply nested child errors.
Transformation Gaps: The Winston log redacter used basic key-value equality to build redaction lists. If a template transformed a secret (such as changing uppercase or lowercase using Nunjucks filters like ${{ secrets.token | upper }}), the redacter could not correlate the transformed token with the original secret representation, allowing the transformed secret to bypass validation filters.
An analysis of the patch in commit 3f1e869708f002fb9838624b7379deb251691b47 reveals the precise architectural changes made to mitigate this exposure.
In plugins/scaffolder-backend/src/scaffolder/tasks/NunjucksWorkflowRunner.ts, the exception handling was modified to actively redact the caught errors before passing them to the state recorder:
// Before Patch
} catch (err) {
await taskTrack.markFailed(step, err);
await stepTrack.markFailed();
throw err;
}
// After Patch
} catch (cause) {
const err = taskLogger.redactError(cause);
await taskTrack.markFailed(step, err);
await stepTrack.markFailed();
throw err;
}The implementation of redactError in logger.ts was rewritten to sanitize errors. Instead of modifying the error object in-place, which could leave nested fields intact, the patch creates a brand-new, sterile error replica holding only sanitized name, message, and stack properties:
const redactError = (error: unknown): ErrorLike => {
if ((typeof error !== 'object' || error === null) && typeof error !== 'function') {
return typeof error === 'string'
? createSanitizedError('Error', redact(error))
: createUnknownError(error);
}
const errorLike = error as Partial<ErrorLike>;
let originalName: unknown;
let originalMessage: unknown;
let originalStack: unknown;
try {
originalName = errorLike.name;
originalMessage = errorLike.message;
originalStack = errorLike.stack;
} catch {
return createSanitizedError(); // Safe fallback for throwing getters
}
if (typeof originalName !== 'string' || !originalName || typeof originalMessage !== 'string') {
return createUnknownError(error);
}
const name = redact(originalName);
const message = redact(originalMessage);
const stack = typeof originalStack === 'string' ? redact(originalStack) : undefined;
return createSanitizedError(name, message, stack);
};This defensive approach effectively strips out any non-standard metadata, custom error attributes, or nested prototype properties, preventing data leaks from alternative object fields.
In terms of completeness, this fix is highly robust. By detaching custom attributes and recreating a standardized object rather than attempting to recursively filter unknown nested fields, the patch addresses both the AggregateError issue and any potential exploitation involving custom getter functions on error objects.
To exploit this vulnerability, an attacker must have authenticated access to the Backstage instance with permissions sufficient to register a template, trigger a template run, or read the event log of an existing task.
An attacker can trigger this information leak by crafting a software template that deliberately forces a failure within an action executing with elevated credentials.
For example, an attacker can define a step that relies on a secret but targets an invalid endpoint or provides bad parameters to a CLI execution. When the step fails, the action handler raises an exception containing the evaluated secret parameter. This unredacted string is written directly to the task_events database.
The attacker then makes an authorized HTTP request to the Scaffolder events endpoint for that specific task: /api/scaffolder/v2/tasks/<task_id>/events. The response contains the raw execution logs, including the error object fields containing the plain-text credentials.
The security impact of this vulnerability is classified as Medium. Although it leads to high confidentiality compromise (C:H), exploitation is restricted by attack complexity and privileges required. The attacker must possess authenticated access to the Backstage platform and the ability to trigger or monitor specific Scaffolder tasks.
Despite the Medium CVSS rating, the operational risk remains significant. The credentials stored in Backstage software templates typically belong to high-privilege service accounts or organization-wide deploy tokens. Exfiltration of these tokens can allow attackers to bypass standard access controls on Git repositories, enabling supply chain attacks or giving them the ability to write malicious code to production branches.
Remediation requires upgrading the @backstage/plugin-scaffolder-backend package or the overarching Backstage release.
Because task events are stored in the database, upgrading the software prevents future leaks but does not delete historical records. Security teams should run cleanup scripts to purge potentially leaked secrets from the database.
For teams unable to patch immediately, temporary mitigations include implementing strict access controls on the task events API and monitoring database event tables for standard credential regular expressions.
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
@backstage/plugin-scaffolder-backend Backstage | < 4.1.0 | 4.1.0 |
Backstage (Core Repository) Backstage | < v1.54.6 | v1.54.6 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-532 |
| Attack Vector | Network (AV:N) |
| CVSS Base Score | 5.3 |
| EPSS Score | 0.00284 |
| Impact | High Confidentiality Loss (C:H) |
| Exploit Status | none |
| CISA KEV Status | Not Listed |
The product writes sensitive information to log files, making it retrieveable by individuals who have read access to the logs or events database.
Canonical LXD and LXC Incus contain an arbitrary file write vulnerability (CWE-73 / CWE-59) in the `/1.0/instances/<name>/exec` REST API endpoint. When an instance is unpacked from an image archive, top-level symbolic links are extracted directly onto the host filesystem within the instance storage directory. If a crafted image includes a symbolic link named `exec-output` pointing to an arbitrary host path, invoking the execution endpoint with `record-output: true` causes the privileged host daemon to follow the symlink and write command output files directly to the target host directory. An authenticated attacker with permissions to import images and execute commands can exploit this flaw to write controlled content to sensitive host directories such as `/etc/cron.d`, resulting in arbitrary code execution on the host as `root`.
CVE-2026-48749 (tracked as GHSA-vghh-5rfx-xhq8 for LXD and GHSA-2q3f-q5pq-g8wv for Incus) is a critical container escape vulnerability in the Canonical LXD and Linux Containers Incus system container managers. By importing a specially crafted container image archive containing duplicate tar member headers, an authenticated attacker can replace the instance rootfs directory with a symbolic link pointing to the underlying host root filesystem. When performing file operations on a stopped container, the privileged forkfile helper binary resolves the symbolic link without confinement and chroots directly into the host filesystem, granting arbitrary root-level file read and write access.
GHSA-fmc8-p6q7-75cc (associated with CVE-2026-48755) is a critical argument injection vulnerability in Canonical LXD (github.com/canonical/lxd). The vulnerability occurs during instance and storage volume backup operations when processing the user-supplied compression_algorithm configuration parameter. While LXD validates the primary executable token against an allowlist of supported compression binaries, it fails to sanitize or restrict subsequent tokens parsed via shellquote.Split. These additional arguments are passed directly to exec.Command. An authenticated attacker with privileges to trigger backups can inject command-line flags for utilities like zstd to read staged files from a container filesystem and write them to arbitrary paths on the underlying host filesystem, such as /etc/cron.d/, achieving root-level arbitrary code execution on the host.
A critical path traversal vulnerability caused by improper input validation (CWE-20) exists in the direct image download handler of Canonical LXD and Linux Containers Incus. When an authenticated user requests an image import using the URL source type, the daemon reads the image fingerprint from an untrusted HTTP response header (`Incus-Image-Hash` or `LXD-Image-Hash`) without validating that it conforms to a SHA-256 format. This unvalidated string is concatenated directly into a filesystem path via `filepath.Join` prior to file creation and cryptographic verification, allowing directory traversal sequences to write arbitrary files on the host filesystem as root.
CVE-2026-9639 (GHSA-j93m-3j9p-m5m8) is a null pointer dereference vulnerability in Canonical LXD affecting versions 5.0.0 through 5.21.4 and 6.0 through 6.8. The flaw resides in the (*lxdBackend).CreateCustomVolumeFromBackup method within lxd/storage/backend_lxd.go. An authenticated attacker with the can_create_storage_volumes permission can upload a crafted custom volume backup tarball that omits the expires_at field on a snapshot entry, triggering an unhandled SIGSEGV panic and terminating the LXD daemon.
An operating system command injection vulnerability (CWE-78) exists in GeoNode versions prior to 5.1.0. The vulnerability occurs in the vector upload processing pipeline when handling user-supplied geospatial files. By supplying a crafted layer name containing shell metacharacters, an authenticated attacker with basic data upload privileges can execute arbitrary commands on the underlying server or container hosting the GeoNode application and Celery worker processes.