CVE-2023-35926: Insecure sandbox in Backstage Scaffolder plugin
Backstage is an open platform for building developer portals. The Backstage scaffolder-backend plugin uses a templating library that requires sandbox, as it by design allows for code injection. The library used for this sandbox so far has been vm2, but in light of several past vulnerabilities and existing vulnerabilities that may not have a fix, the plugin has switched to using a different sandbox library. A malicious actor with write access to a registered scaffolder template could manipulate the template in a way that allows for remote code execution on the scaffolder-backend instance. This was only exploitable in the template YAML definition itself and not by user input data. This is vulnerability is fixed in version 1.15.0 of @backstage/plugin-scaffolder-backend.
Other sources
The Backstage scaffolder-backend plugin uses a templating library that requires a sandbox, as it by design allows for code injection. The library used for this sandbox so far has been vm2, but in light of several past vulnerabilities and existing vulnerabilities that may not have a fix, the plugin has switched to using a different sandbox library.
Impact
A malicious actor with write access to a registered scaffolder template could manipulate the template in a way that allows for remote code execution on the scaffolder-backend instance. This was only exploitable in the template YAML definition itself and not by user input data.
Patches
This is vulnerability is fixed in version 1.15.0 of @backstage/plugin-scaffolder-backend.
Workarounds
Note that the Backstage Threat Model states that scaffolder templates are considered to be a sensitive area that with the recommendation that you control access and perform manual reviews of changes to the scaffolder templates. The exploit is of a nature where it is easily discoverable in manual review.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
npm/@backstage/plugin-scaffolder-backendto a version that resolves this vulnerability.Fixed in 1.15.0 - Upgrade
Upgrade
@backstage/plugin-scaffolder-backendto a version that resolves this vulnerability.Fixed in 1.15.0 - Compensating control
Control access to Backstage scaffolder templates and perform manual reviews of changes to the scaffolder templates (templates are considered a sensitive area per the Backstage Threat Model).
Event History
Frequently Asked Questions
What is the severity of CVE-2023-35926?
CVE-2023-35926 has been assessed with a high severity due to its potential for code injection risk.
How do I fix CVE-2023-35926?
To mitigate CVE-2023-35926, update the Backstage scaffolder-backend plugin to version 1.15.0 or higher.
What components are affected by CVE-2023-35926?
CVE-2023-35926 affects the Backstage scaffolder-backend plugin and versions prior to 1.15.0.
Is CVE-2023-35926 exploitable in production environments?
Yes, CVE-2023-35926 is exploitable in production environments if the vulnerable versions are in use.
What is the background of CVE-2023-35926?
CVE-2023-35926 involves a vulnerability in the templating library used by the Backstage scaffolder-backend plugin, which previously relied on the 'vm2' sandbox for code execution.