/

CVE-2026-28370

Severity:

CRITICAL RISK

(9.1)

Dynamic Code Evaluation in OpenStack Vitrage Query Parser

CVE-2026-28370

Modified

Vulnerability type

Category:

Dynamic Code Evaluation

CWE:

CWE-95

Impact:

Remote Code Execution via Vitrage API

Severity:

CRITICAL RISK

(9.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

The OpenStack Vitrage query parser performs dynamic code evaluation in _create_query_function, allowing a user with API access to trigger code execution on the Vitrage service host.

When an attacker can supply crafted query input to the Vitrage API, they may execute arbitrary code as the Vitrage service user, potentially leading to full compromise of the host and the Vitrage service.

Affected context

This vulnerability affects OpenStack Vitrage deployments that:

  • Expose the Vitrage API to users or integrated services
  • Use the vulnerable query parser implementation in vitrage/graph/query.py
  • Allow tenants, operators, or automated components to submit queries to Vitrage

The issue is triggered when user-controlled query input is transformed into executable code in _create_query_function, without sufficient sanitization or isolation.

Exploit preconditions

  • Attack surface: Network-exposed Vitrage API endpoint, typically within an OpenStack control or management plane.
  • Required access: Ability to authenticate to, or otherwise reach, the Vitrage API and submit queries (e.g., as a tenant, operator, or via a compromised service account).
  • Trigger point: Submission of a specially crafted query string that is processed by _create_query_function in vitrage/graph/query.py.
  • Why exploitation is possible: The query parser dynamically evaluates query expressions derived from user input, effectively treating untrusted data as code, enabling arbitrary code execution in the context of the Vitrage service process.

Why this happens

The root cause is the use of dynamic code evaluation constructs on data derived from user-controlled query parameters.

In _create_query_function, query expressions are converted into executable Python code or function objects without strong separation between data and logic.

This aligns with CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection'), where user-controlled input is incorporated into code that is then interpreted or executed by the runtime.

The lack of robust input neutralization, whitelisting of allowed operations, or use of a non–Turing-complete query language means that crafted input can escape intended constraints and invoke arbitrary code paths.

Potential impact

  • Execution of arbitrary Python code on the Vitrage service host as the Vitrage service account
  • Unauthorized access to Vitrage configuration, credentials, or in-memory secrets
  • Lateral movement from the Vitrage host to other OpenStack services or infrastructure components
  • Tampering with Vitrage alarms, root-cause analyses, or topology data to hide or stage further attacks
  • Denial of service of the Vitrage service or instability of the OpenStack control plane

General mitigation guidance

Mitigation generally involves eliminating dynamic interpretation of user input and constraining the query language to data-only constructs.

Recommended defensive patterns include:

  • Replacing dynamic evaluation (e.g., eval-like constructs) with a dedicated, declarative query engine that treats queries as data structures rather than code.
  • Implementing strict parsing with an explicit grammar and AST, rejecting any tokens or operators outside a controlled whitelist.
  • Normalizing and validating query parameters early, ensuring only safe fields, operators, and literal types are accepted.
  • Executing query handling under least privilege, ensuring the Vitrage service account has minimal access on the host and to other services.
  • Introducing defense-in-depth controls (e.g., seccomp, containers, or sandboxing) around services that must process user-controlled expressions.

How teams detect issues like this

Effective detection combines code-centric review with runtime monitoring:

  • Static analysis: Configure rules to flag use of generic dynamic evaluation APIs (e.g., eval, exec, dynamic compilation) when they operate on or concatenate user-controlled input.
  • Code review: Require manual inspection of query parsing and expression-building logic, looking for patterns where input strings are transformed directly into code or lambdas.
  • Policy enforcement: Establish coding standards that prohibit dynamic evaluation of user input and enforce their adoption via pre-commit hooks or CI checks.
  • Runtime monitoring: Track unusual behavior from the Vitrage service process, such as unexpected subprocess creation, file system access, or outbound network connections, which may indicate exploitation attempts.
  • Automated tools: Use SAST/IAST tools configured with rules for eval injection and dynamic code execution, integrated into the development and deployment pipelines.

Sources

SourceLink
github.comgithub.com/openstack/vitrage/blob/a1f86950e1314b0c740f9cd9b7e9dbab7d02af51/vitrage/graph/query.py#L70
storyboard.openstack.orgstoryboard.openstack.org/#%21/story/2011539
openwall.comopenwall.com/lists/oss-security/2026/03/03/6

Frequently asked

questions

Yes, in typical OpenStack deployments any actor with network and logical access to the Vitrage API can attempt to exploit it by submitting crafted queries, making it remotely exploitable within the cloud management plane.

An attacker generally needs the ability to call the Vitrage API—this may require valid OpenStack credentials or a compromised service account. The vulnerability does not require shell access to the host; only API-level access is needed.

The safest pattern is to remove dynamic code evaluation from the query path entirely. Implement a strictly defined, declarative query language with parsing that treats input as data only, and enforce strong validation and whitelisting of allowed operations and fields.

Avoid designs that interpret user input as executable code, adopt coding standards that ban eval-like constructs for untrusted data, incorporate security reviews into query or scripting feature designs, and use static analysis and CI policies to detect dynamic evaluation patterns before they reach production.

Find out what's already
exploitable in your codebase.