Skip to content
RCE Write-up Advanced

Remote Code Execution in Spotify’s Backstage via vm2 Sandbox Escape (CVSS Score of 9.8)

Gal Goldsthein Follow

Published on oxeye.io

The Oxeye research team has been able to gain remote code execution in Spotify’s open source, CNCF-incubated project—Backstage, by exploiting a VM sandbox escape through the vm2 third-party library. We reported this RCE vulnerability via Spotify’s bug bounty program, and the Backstage team responded rapidly by…

Gal Goldsthein (@G4lGo89), Yuval Ostrovsky (@yuvalo1212), Daniel Abeles (@Daniel_Abeles), on oxeye.io

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 8 min read.

Context

Backstage is Spotify's open source developer portal, incubated in the CNCF. It unifies an organisation's infrastructure tooling, services and documentation into a single development environment, and it is used by organisations including American Airlines, Netflix, Splunk, Fidelity Investments and Epic Games. Because a Backstage instance can hold integration details for systems such as Prometheus, Jira and ElasticSearch, a compromise there has implications for those services and the data they hold.

Out of the box Backstage ships a software catalogue, software templates, techdocs and a plugin ecosystem. The Oxeye research team focused on software templates: an application owner uses them to spin up new projects, components and plugins according to the organisation's best practices. Each template is a YAML file resembling a Kubernetes resource, with fields that define how the component should behave.

From the original on oxeye.io

The data passed to the template's message parameter is rendered by Nunjucks, Backstage's template rendering engine. Nunjucks is a JavaScript engine inspired by Jinja2. Evaluating user-provided strings in a template engine is dangerous because it exposes the application to template-based attacks, and the severity depends on what the engine offers. Nunjucks is powerful but has a history of being unsafe; a 2016 blog post describes popular techniques for bypassing the restrictions it imposes.

Backstage has three parts: the core, built by the open source project's developers; the app, an instance deployed and tweaked by app developers, usually a productivity team; and plugins, which add functionality and may be company-specific or open sourced.

Setup

The researchers exploited a VM sandbox escape in the vm2 third-party library through the Scaffolder core plugin. They reported the issue through Spotify's bug bounty program. The Backstage team patched it in version 1.5.1 and ranked it with a CVSS score of 9.8. The work builds on an earlier Oxeye paper that found a vm2 sandbox escape resulting in remote code execution on the hosting machine (CVE-2022-36067).

Finding it

Reviewing how to confine the template risk, the team noticed that the templating engine could be manipulated to run shell commands by using user-controlled templates with Nunjucks outside an isolated environment. As a result, Backstage started using the vm2 JavaScript sandbox library to mitigate the risk. The question the researchers then asked was whether their existing vm2 escape payload could be made to work inside Backstage.

In the earlier research they had controlled properties outside the sandbox context by invoking the getThis method on CallSite objects in the array produced from a raised error's call stack. Their first attempt in Backstage stored the vm2 sandbox escape payload in a Backstage template YAML and tried to trigger it. Calling getThis returned undefined, and the exploit failed.

From the original on oxeye.io

The reason is in the v8 documentation:

To maintain restrictions imposed on strict mode functions, frames that have a strict mode function and all frames below (its caller, etc.) are not allowed to access their receiver and function objects. For those frames, getFunction() and getThis() returns undefined

To find out which functions in the call stack run in strict mode, they added a code snippet to the functions that appeared in the stack.

From the original on oxeye.io

Running the payload again with that snippet showed that the earliest function executed in strict mode inside the vm2 sandbox was renderString2.

From the original on oxeye.io

Exploitation

Step 1: Override the strict-mode function

To get around the strict-mode restriction, the researchers overrode renderString2 with their own implementation, aiming to force it to run in non-strict mode. A second behaviour helped: when rendering the template raised an error, Backstage called renderString2 a second time. That allowed the payload to be split into two stages. First the original renderString2 is overwritten with the attacker's implementation; then an error is triggered, so Backstage calls the function again and this time runs the overridden version.

From the original on oxeye.io

The final payload was:

From the original on oxeye.io

The researchers explained it in these steps:

  1. Access the range function constructor property, which provides access to the sandboxed Function constructor. That is used to create an immediately invoked function expression (IIFE) containing the exploit code, within Nunjucks's rendering engine context.
  2. Override the renderString function with their own implementation so it runs in the context of the VM rather than Nunjucks. This is essential to exploit the vulnerability; env here is the Nunjucks reference.
  3. Trigger an error by invoking an undefined function (triggerException). This causes NunjucksWorkflowRunner.render to call SecureTemplater.render a second time, in the code at plugins/scaffolder-backend/src/scaffolder/tasks/NunjucksWorkflowRunner.ts (line 147 in commit [redacted]).

From that point the exploit runs in the context of the vm2 sandbox:

  1. Save a copy of the original Error class.
  2. Override the original Error class with a new empty class.
  3. Implement the prepareStackTrace function under the newly created Error class.
  4. Create an instance of the saved Error class and access its stack property. This triggers the built-in Node error module to call the custom prepareStackTrace implementation (in lib/internal/errors.js, line 140).
  5. Access the CallSite object supplied in the traces array and invoke getThis on it. This returns an object created outside the sandbox, which allows execution of an arbitrary system command.

Looking at the call stack while the payload ran, none of the functions executed until the overridden renderString2 was declared as strict. Accessing index 2 of the trace array returned a CallSite object created outside the sandbox, which enabled arbitrary code execution.

From the original on oxeye.io

Step 2: Assessing exposure in the wild

With the payload working locally, the team assessed the impact if the vulnerability were exploited in the wild. A simple Shodan query for the Backstage favicon hash returned more than 500 Backstage instances exposed to the internet. They then tried to work out how those could be exploited remotely without authenticating to the target instance.

From the original on oxeye.io

The first observation was that Backstage is deployed by default without an authentication or authorisation mechanism, which allows guest access. Some of the public Backstage servers reachable from the internet required no authentication at all.

A warning message in the Backstage authentication documentation also caught their attention.

They then set up a local Backstage instance that requires authentication, following tutorial guidelines originally maintained by Backstage. The result was authentication enforced only on the client side: requests flowing to the backend API were not verified for authentication or authorisation.

From the original on oxeye.io

When sending requests directly to the backend API server of some of the internet-exposed instances, they found a handful that required no form of authentication or authorisation. They concluded the vulnerability could be exploited without authentication on many instances.

Root cause

Backstage renders user-controlled template data with Nunjucks, and to contain the risk of template-based attacks it runs that rendering inside the vm2 JavaScript sandbox. The escape abuses the sandbox's handling of the call stack: by overriding renderString2 with a non-strict implementation and forcing Backstage to call it a second time through a rendering error, the attacker gets frames in the stack that are not strict, so getThis on the CallSite at index 2 returns an object created outside the sandbox. From there an arbitrary system command can be executed.

The strict-mode restriction that v8 applies to getThis and getFunction is what stopped the first, simpler attempt, and the two-stage override is what defeats it. On the deployment side, the default configuration without authentication or authorisation, and the client-side-only enforcement seen when following the authentication tutorial, meant many internet-exposed instances could be reached without credentials.

Impact

An unauthenticated threat actor can execute arbitrary system commands on a Backstage application by exploiting the vm2 sandbox escape in the Scaffolder core plugin. Because Backstage can hold integration details for systems such as Prometheus, Jira and ElasticSearch, successful exploitation has critical implications for an affected organisation and can compromise those services and the data they hold. The researchers found more than 500 Backstage instances exposed to the internet and concluded the vulnerability could be exploited without authentication on many instances.

Fix

The Backstage team patched the vulnerability in version 1.5.1. The researchers recommend updating Backstage to the latest version as soon as possible. More generally, when choosing a template engine, pick one with security in mind: robust engines are useful but can pose a risk. The root of any template-based VM escape is gaining JavaScript execution rights within the template, and using logic-less engines such as Mustache avoids introducing server-side template injection; separating logic from presentation as much as possible reduces exposure to the most dangerous template-based attacks. If Backstage is used with authentication, enable it for both the frontend and the backend.

Variants to test

  1. Other Backstage template fields rendered by Nunjucks. Place a sandbox escape payload in any template field that reaches the renderer, not only message. A positive result is command execution on the host running Backstage.
  2. Other functions in the call stack that run in strict mode. Instrument the stack as the researchers did to find the earliest strict-mode function, then override it and trigger a second render through an error. A positive result is a CallSite whose getThis returns an object from outside the sandbox.
  3. Backend APIs of internet-exposed instances. Send requests directly to the backend API server rather than through the UI. A positive result is a response to an unauthenticated request that the frontend would normally gate.
  4. Deployments following the authentication tutorial. Set up an instance per the tutorial and check whether the backend verifies authentication and authorisation. A positive result is a backend request succeeding without credentials.
  5. Other vm2-based template pipelines. Apply the same two-stage override and error-trigger pattern wherever user-controlled templates are rendered inside vm2. A positive result is arbitrary command execution from template input.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 19 min read.

What happened, in plain words

A team of security researchers at Oxeye found a way to take over a Backstage server, which is a piece of software made by Spotify that companies use to organise their internal developer tools. They could make the server run any command they wanted, without logging in first. They reported it through Spotify's bug bounty program, the Backstage team fixed it in version 1.5.1, and the vulnerability was given a severity rating of 9.8 out of 10 (a scoring system called CVSS, explained in the glossary).

The trick relied on a small library called vm2, which Backstage uses to run untrusted template code in a sealed-off box (a "sandbox"). The researchers found a way to break out of that box. They then checked how many Backstage servers were reachable on the public internet and how many of them let anyone in without a password. They found more than 500 exposed instances, and a handful of those they tested required no authentication.

This article walks through the whole story from scratch, assuming you have never read a security report before. Every technical word is explained the first time it appears, and there is a glossary at the end.

Background: what Backstage is

Backstage is an open source project. "Open source" means the code is public and anyone can read it, use it or contribute to it. It is hosted by the CNCF, a foundation that looks after well-known infrastructure projects. On GitHub, the site where open source code lives, it had more than 19,000 stars at the time of the research. A "star" is roughly a bookmark plus a thumbs-up.

What Backstage does, in everyday terms: imagine a large company with hundreds of small programs (microservices), each with its own documentation, deployment settings and dashboards. Without a central place to look, engineers waste time hunting for links and settings. Backstage is that central place. It pulls all of it into one portal.

It is used by organisations including American Airlines, Netflix, Splunk, Fidelity Investments and Epic Games.

A Backstage instance can also store the connection details for other systems, such as Prometheus (a monitoring tool), Jira (a ticket tracker) and ElasticSearch (a search database). That matters for the impact: if an attacker takes over Backstage, they may also get the keys to those connected systems and the data inside them.

Out of the box, Backstage includes:

  • Backstage software catalogue for managing all your software (microservices, libraries, data pipelines, websites, ML models, etc.)
  • Backstage software templates for quickly spinning up new projects and standardizing your tooling with your organization's best practices
  • Backstage techdocs for making it easy to create, maintain, find, and use technical documentation, using a "docs-like code" approach
  • A growing ecosystem of open source plugins that further expand its customizability and functionality

A "plugin" is an add-on, like an extension in a browser. "Techdocs" is just documentation stored next to the code.

Backstage has three parts:

  • Core: the base functionality built by the open source project's own developers.
  • App: a specific deployed copy of Backstage, set up and tweaked by a company, usually by an internal productivity team.
  • Plugins: add-ons that make the app more useful. They can be private to a company or shared publicly.

The feature the researchers focused on: software templates

Every security research project starts by listing the ways a user can send data into an application. Those entry points are called "inputs". The researchers' attention landed on software templates.

A software template is a recipe. An application owner fills it in, and Backstage creates a new project, component or plugin following the company's standards. Think of it like a form on a website that generates a new document for you.

Each template is defined by a YAML file. YAML is a plain-text format for writing structured settings, similar to a shopping list with indentation. It resembles a Kubernetes resource, which is the configuration format used by Kubernetes, a popular system for running containers. The file has fields that define how the generated component should behave. For example:

From the original on oxeye.io

The image shows an example of such a template YAML file, with its fields laid out.

One of those fields is called message. Whatever text is put into message is not shown as plain text: it is processed by a template engine called Nunjucks. A template engine is a program that takes a piece of text containing placeholders and special instructions and turns it into a finished output. For example, a template might say "Hello {{ name }}" and the engine replaces {{ name }} with an actual name.

Nunjucks is a JavaScript template engine inspired by Jinja2, a well-known engine from the Python world. JavaScript is the programming language that runs in web browsers and in Node.js (a way of running JavaScript on a server).

Here is the danger: if a template engine processes text that a user controls, and that engine is powerful enough to run code, then the user can smuggle code into the template. This class of attack is called server-side template injection, or SSTI. The severity depends on what the engine can do. Nunjucks is powerful, and it has a history of being unsafe. A 2016 blog post (linked in the original research) describes popular techniques for getting around the restrictions Nunjucks tries to impose.

The mitigation Backstage tried: a sandbox

Because of this risk, Backstage's developers did not run Nunjucks directly on the server. Instead, they wrapped it in a sandbox. A sandbox is a sealed-off environment: code runs inside it, but it is supposed to be unable to touch anything outside. A useful comparison is a playpen: a child can move around freely inside, but cannot leave.

The specific sandbox library Backstage used is called vm2. It is a third-party library, meaning it is not written by the Backstage team but by someone else, and Backstage just uses it.

In an earlier research paper, the same Oxeye team had already found a way to break out of vm2. That escape results in remote code execution, or RCE. RCE means an attacker can make the target machine run any command they choose, as if they were sitting at its keyboard. The earlier escape was tracked as CVE-2022-36067. A CVE is a public identifier for a known vulnerability, like a case number.

Once the researchers had that escape working, they asked a natural follow-up question: could the same payload work inside Backstage?

The first attempt, and why it failed

In the earlier research, the escape worked by reaching objects that live outside the sandbox. The technique involved raising an error on purpose, then reading the error's "call stack".

The call stack is the list of functions that are currently running, in order. If function A calls function B, and B calls C, the stack is A, B, C. When an error happens, JavaScript records this list so you can see where things went wrong. Each entry in that list is represented by an object called a CallSite.

On each CallSite, there is a method called getThis. A method is a function attached to an object. getThis returns the object that the function was called on, which is a way of reaching into the surrounding program. If getThis returns something that lives outside the sandbox, the attacker can use it to run code outside the sandbox too.

The first attempt in Backstage was simple: put the vm2 escape payload into a Backstage template YAML and trigger it. But calling getThis returned undefined. In JavaScript, undefined means "no value at all". The exploit failed.

From the original on oxeye.io

The image shows the failed attempt: the payload was placed in a template YAML, but getThis came back undefined.

Why it failed: strict mode

To understand the failure, the researchers looked at the documentation for v8. V8 is the JavaScript engine, the program that actually reads and runs JavaScript. It is used by Google Chrome and by Node.js. The documentation said:

To maintain restrictions imposed on strict mode functions, frames that have a strict mode function and all frames below (its caller, etc.) are not allowed to access their receiver and function objects. For those frames, getFunction() and getThis() returns undefined

What is strict mode? JavaScript has an optional mode called strict mode that makes the language more careful: it forbids certain sloppy behaviours. One of the restrictions is that, for functions running in strict mode, the engine will not hand out the function's "receiver" (the object it was called on) or the function object itself. And crucially, that restriction applies not only to the strict function but to every function below it in the call stack, meaning every function that called it.

So if any function in the chain is strict, getThis returns undefined for that frame and all the frames beneath it. That is exactly what the researchers saw.

To find out which functions in the call stack were running in strict mode, they added a small code snippet to the functions that appeared in the stack.

From the original on oxeye.io

The image shows the snippet they added to each function in the stack, so they could see which ones were strict.

When they ran the payload again with that snippet, they could see that the earliest function executed in strict mode inside the vm2 sandbox was a function called renderString2.

From the original on oxeye.io

The image shows renderString2 running in strict mode, which is what blocked the escape.

Getting around it: two stages

To defeat the restriction, the researchers decided to override renderString2 with their own implementation. "Override" means replacing an existing function with a different one. Their replacement would not be strict, so the restriction would no longer apply.

A second behaviour helped them. When rendering a template raised an error, Backstage called renderString2 a second time. That gave them a way to split the attack into two stages:

  1. First, overwrite renderString2 with the attacker's version.
  2. Then trigger an error, so Backstage calls the function again, and this time it runs the attacker's version.
From the original on oxeye.io

The image shows Backstage calling renderTemplate (which calls renderString2) twice when an error occurs.

The final payload was:

From the original on oxeye.io

The image shows the final payload as it was written.

The researchers explained it in these steps:

  1. Access the range function constructor property, which provides access to the sandboxed Function constructor. That is used to create an immediately invoked function expression (IIFE) containing the exploit code, within Nunjucks's rendering engine context.
  2. Override the renderString function with their own implementation so it runs in the context of the VM rather than Nunjucks. This is essential to exploit the vulnerability; env here is the Nunjucks reference.
  3. Trigger an error by invoking an undefined function (triggerException). This causes NunjucksWorkflowRunner.render to call SecureTemplater.render a second time, in the code at plugins/scaffolder-backend/src/scaffolder/tasks/NunjucksWorkflowRunner.ts (line 147 in commit [redacted]).

Let us unpack those three steps in plain words.

Step 1: the Function constructor. In JavaScript, Function is a built-in that lets you create a new function from a string of code. It is like a machine that turns text into executable code. If an attacker can reach Function, they can run arbitrary code. The range object here is a Nunjucks helper that happens to expose a constructor property, and from there the sandboxed Function constructor can be reached. An IIFE (immediately invoked function expression) is a function that runs the moment it is defined, with no need to call it separately. The researchers used it to run their exploit code inside Nunjucks's rendering context.

Step 2: overriding renderString. The original renderString is Nunjucks's own function. By replacing it, the attacker's code runs in the context of the VM (the sandbox) instead of inside Nunjucks. That is the key move: it puts the attacker's code where the escape can work. env is the variable that refers to the Nunjucks environment.

Step 3: triggering an error. Calling a function that does not exist (triggerException) raises an error. Backstage's error handling then calls SecureTemplater.render a second time, which is the second stage of the attack. The code that does this is in the file NunjucksWorkflowRunner.ts, at line 147 of the commit named above.

From that point, the exploit runs in the context of the vm2 sandbox:

  1. Save a copy of the original Error class.
  2. Override the original Error class with a new empty class.
  3. Implement the prepareStackTrace function under the newly created Error class.
  4. Create an instance of the saved Error class and access its stack property. This triggers the built-in Node error module to call the custom prepareStackTrace implementation (in lib/internal/errors.js, line 140).
  5. Access the CallSite object supplied in the traces array and invoke getThis on it. This returns an object created outside the sandbox, which allows execution of an arbitrary system command.

Again, in plain words:

  • Error class. In JavaScript, Error is the built-in type used to represent errors. Every error has a stack property, which is the call stack at the moment the error was created.
  • prepareStackTrace. This is a hook: a function you can supply that Node.js (the JavaScript runtime on the server) will call whenever it needs to format an error's stack. By supplying your own, you control what happens when the stack is read.
  • The trick. The attacker saves the real Error, replaces it with an empty class, and attaches their own prepareStackTrace to the replacement. Then they create an instance of the saved (real) Error and read its stack. Node.js calls the attacker's prepareStackTrace, which receives the list of CallSite objects. The attacker picks one and calls getThis on it. Because the attacker's renderString2 was not strict, the restriction no longer applies, and getThis returns an object from outside the sandbox. From there, an arbitrary system command can be run.

Looking at the call stack while the payload ran, none of the functions executed until the overridden renderString2 was declared as strict. Accessing index 2 of the trace array returned a CallSite object created outside the sandbox, which enabled arbitrary code execution.

From the original on oxeye.io

The image shows the call stack at the moment of success: index 2 of the trace array holds a CallSite from outside the sandbox.

Checking how many servers were exposed

With the payload working locally, the team wanted to know what would happen if someone used it in the wild. "In the wild" means on real, internet-facing systems, not in a lab.

They ran a simple Shodan query for the Backstage favicon hash. Shodan is a search engine for internet-connected devices and services: instead of indexing web pages, it indexes servers. A favicon is the little icon shown in a browser tab. Its "hash" is a short fingerprint computed from the icon file. Many Backstage instances share the same default favicon, so searching for that hash finds them.

The query returned more than 500 Backstage instances exposed to the internet. The researchers then tried to work out how those could be exploited remotely without authenticating to the target instance. "Authenticating" means proving who you are, usually with a username and password.

From the original on oxeye.io

The image shows the Shodan results: more than 500 Backstage instances reachable from the internet.

The first observation was that Backstage is deployed by default without an authentication or authorisation mechanism, which allows guest access. Authentication is proving who you are; authorisation is what you are allowed to do once you are in. "Guest access" means anyone can walk in without proving anything. Some of the public Backstage servers reachable from the internet required no authentication at all.

A warning message in the Backstage authentication documentation also caught their attention.

The image shows the warning message in the documentation.

They then set up a local Backstage instance that requires authentication, following tutorial guidelines originally maintained by Backstage. The result was authentication enforced only on the client side: requests flowing to the backend API were not verified for authentication or authorisation.

This is an important distinction. A web application usually has two halves: the frontend (what you see in the browser) and the backend (the server that holds the data and does the work). The two talk to each other through an API, which is a defined set of URLs the frontend can call. "Client-side enforcement" means the browser checks whether you are logged in, but the server does not. Anyone who skips the browser and talks to the API directly gets in without a password. It is like a nightclub where the bouncer checks IDs at the front door but the back door is wide open.

From the original on oxeye.io

The image shows the local setup: authentication only on the client side, with backend API requests unverified.

When sending requests directly to the backend API server of some of the internet-exposed instances, they found a handful that required no form of authentication or authorisation. They concluded the vulnerability could be exploited without authentication on many instances.

The root cause, summarised

Backstage renders user-controlled template data with Nunjucks, and to contain the risk of template-based attacks it runs that rendering inside the vm2 JavaScript sandbox. The escape abuses the sandbox's handling of the call stack: by overriding renderString2 with a non-strict implementation and forcing Backstage to call it a second time through a rendering error, the attacker gets frames in the stack that are not strict, so getThis on the CallSite at index 2 returns an object created outside the sandbox. From there an arbitrary system command can be executed.

The strict-mode restriction that v8 applies to getThis and getFunction is what stopped the first, simpler attempt, and the two-stage override is what defeats it. On the deployment side, the default configuration without authentication or authorisation, and the client-side-only enforcement seen when following the authentication tutorial, meant many internet-exposed instances could be reached without credentials.

Impact

An unauthenticated threat actor can execute arbitrary system commands on a Backstage application by exploiting the vm2 sandbox escape in the Scaffolder core plugin. "Scaffolder" is the part of Backstage that handles software templates. "Unauthenticated" means the attacker does not need an account or password.

Because Backstage can hold integration details for systems such as Prometheus, Jira and ElasticSearch, successful exploitation has critical implications for an affected organisation and can compromise those services and the data they hold. In other words, taking over Backstage can be a stepping stone to taking over the systems it is connected to.

The researchers found more than 500 Backstage instances exposed to the internet and concluded the vulnerability could be exploited without authentication on many instances.

The fix

The Backstage team patched the vulnerability in version 1.5.1. "Patched" means they released an updated version that closes the hole. The researchers recommend updating Backstage to the latest version as soon as possible.

More generally, when choosing a template engine, pick one with security in mind: robust engines are useful but can pose a risk. The root of any template-based VM escape is gaining JavaScript execution rights within the template, and using logic-less engines such as Mustache avoids introducing server-side template injection. Mustache is a template engine that deliberately cannot run logic: it only substitutes values, so there is nothing to smuggle code into. Separating logic from presentation as much as possible reduces exposure to the most dangerous template-based attacks.

If Backstage is used with authentication, enable it for both the frontend and the backend. The frontend check is a convenience; the backend check is the one that actually protects the data.

Variants to test

  1. Other Backstage template fields rendered by Nunjucks. Place a sandbox escape payload in any template field that reaches the renderer, not only message. A positive result is command execution on the host running Backstage.
  2. Other functions in the call stack that run in strict mode. Instrument the stack as the researchers did to find the earliest strict-mode function, then override it and trigger a second render through an error. A positive result is a CallSite whose getThis returns an object from outside the sandbox.
  3. Backend APIs of internet-exposed instances. Send requests directly to the backend API server rather than through the UI. A positive result is a response to an unauthenticated request that the frontend would normally gate.
  4. Deployments following the authentication tutorial. Set up an instance per the tutorial and check whether the backend verifies authentication and authorisation. A positive result is a backend request succeeding without credentials.
  5. Other vm2-based template pipelines. Apply the same two-stage override and error-trigger pattern wherever user-controlled templates are rendered inside vm2. A positive result is arbitrary command execution from template input.

Disclosure timeline

From the original on oxeye.io

The image shows the disclosure timeline.

Glossary

  • API: a defined set of URLs and rules that let one piece of software talk to another, usually the frontend talking to the backend.
  • Authentication: proving who you are, typically with a username and password.
  • Authorisation: what you are allowed to do once you have proven who you are.
  • Backend: the server-side part of an application that holds data and does the work.
  • Backstage: Spotify's open source developer portal, used to organise an organisation's software, documentation and tooling.
  • Bug bounty program: a scheme where a company pays researchers for reporting security bugs responsibly.
  • Call stack: the ordered list of functions currently running, from the outermost caller to the innermost callee.
  • CallSite: an object representing one entry in a call stack.
  • Client-side: code that runs in the user's browser, as opposed to on the server.
  • CNCF: Cloud Native Computing Foundation, a body that hosts open source infrastructure projects.
  • Core: the base functionality of Backstage built by the open source project's developers.
  • CVE: a public identifier assigned to a known vulnerability.
  • CVSS: a scoring system for vulnerability severity, from 0 to 10.
  • Error class: JavaScript's built-in type for representing errors, with a stack property.
  • Favicon hash: a fingerprint computed from a website's tab icon, used to find instances of the same software.
  • Frontend: the part of an application you see and interact with in the browser.
  • Function constructor: a JavaScript built-in that creates a new function from a string of code.
  • getThis: a method on a CallSite that returns the object the function was called on.
  • IIFE: immediately invoked function expression, a function that runs as soon as it is defined.
  • In the wild: on real, internet-facing systems, as opposed to in a lab.
  • JavaScript: the programming language that runs in browsers and, via Node.js, on servers.
  • Jinja2: a Python template engine that inspired Nunjucks.
  • Kubernetes: a system for running and managing containers, configured with YAML files.
  • Logic-less template engine: a template engine that only substitutes values and cannot run logic, such as Mustache.
  • Microservice: a small, independently deployable piece of software within a larger system.
  • Mustache: a logic-less template engine.
  • Node.js: a runtime that lets JavaScript run on a server.
  • Nunjucks: a JavaScript template engine, inspired by Jinja2, used by Backstage.
  • Open source: software whose code is public and can be read, used and modified by anyone.
  • Override: to replace an existing function with a different implementation.
  • Payload: the piece of code or data an attacker sends to trigger an exploit.
  • Plugin: an add-on that extends an application's functionality.
  • prepareStackTrace: a Node.js hook that lets you supply your own function for formatting an error's stack.
  • RCE (remote code execution): the ability for an attacker to run arbitrary commands on a target machine.
  • Sandbox: a sealed-off environment where code can run without being able to affect anything outside.
  • Scaffolder: the part of Backstage that handles software templates.
  • Shodan: a search engine that indexes internet-connected servers and services.
  • Software template: a recipe in Backstage for creating a new project, component or plugin.
  • SSTI (server-side template injection): an attack where user input is processed by a template engine in a way that lets the user run code.
  • Strict mode: an optional JavaScript mode that forbids certain sloppy behaviours and restricts access to function receivers.
  • Third-party library: code written by someone other than the main project's developers and used by the project.
  • V8: the JavaScript engine used by Chrome and Node.js.
  • vm2: a JavaScript sandbox library used by Backstage to contain template rendering.
  • YAML: a plain-text format for structured configuration, using indentation.

More from Spotify

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.