Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2026-29090 — rucio

🔴 CVSS 9.5 — Critical ✅ No Known Exploit CWE-89 OSV
9.5
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

Rucio has SQL Injection in FilterEngine PostgreSQL Query Builder via DID Search API

Summary

A SQL injection vulnerability in FilterEngine.create_postgres_query allows any authenticated Rucio user to execute arbitrary SQL against the configured PostgreSQL metadata database through the DID search endpoint (GET /dids/<scope>/dids/search). When the external metadata plugin postgres_meta is configured, attacker-controlled filter keys and values are interpolated directly into raw SQL statements via Python str.format. This enables full database compromise including data exfiltration, data modification, and potential remote code execution via COPY ... FROM PROGRAM.

Details

The vulnerability exists in lib/rucio/core/did_meta_plugins/filter_engine.py within the create_postgres_query() method (lines 408-484). This method builds raw SQL strings via Python .format() across 6 distinct injection points:

filter_engine.py:477 (string equality — default branch):

```python

expression = "{}->>'{}' {} '{}'".format(jsonb_column, key, POSTGRES_OP_MAP[oper], value)

```

filter_engine.py:442 (wildcard/LIKE branch):

```python

expression = "{}->>'{}' LIKE '{}' ".format(jsonb_column, key, value.replace('*', '%'))

```

filter_engine.py:456 (boolean branch — value unquoted):

```python

expression = "({}->>'{}' )::boolean {} {}".format(jsonb_column, key, POSTGRES_OP_MAP[oper], value)

```

filter_engine.py:462 (numeric branch — value unquoted):

```python

expression = "({}->>'{}' )::float {} {}".format(jsonb_column, key, POSTGRES_OP_MAP[oper], value)

```

filter_engine.py:472 (datetime branch):

```python

expression = "({}->>'{}' )::timestamp {} '{}'".format(jsonb_column, key, POSTGRES_OP_MAP[oper], value)

```

filter_engine.py:479 (non-JSONB column fallback):

```python

expression = "{} {} '{}'".format(key, POSTGRES_OP_MAP[oper], value)

```

Both key and value are attacker-controlled strings derived from HTTP query parameters. The resulting expression string is concatenated into a larger query string (postgres_query_str) that is then passed to psycopg3's sql.SQL():

```python

# postgres_meta.py:314-316

statement = sql.SQL("SELECT * FROM {} WHERE {} {}").format(

sql.Identifier(self.table),

sql.SQL(postgres_query_str), # <-- UNSANITIZED user-derived string

sql.SQL("LIMIT {}").format(sql.Literal(limit)) if limit else sql.SQL("")

)

```

sql.SQL() wraps the string as a trusted SQL syntax fragment — it does not escape or parameterize its contents. The statement is then executed via cur.execute(statement) at postgres_meta.py:321.

Why no existing defense blocks this

The data flow from HTTP request to SQL execution passes through multiple layers with no effective sanitization:

1. HTTP input (dids.py:265-274): Filter keys and values are accepted from query parameters via ast.literal_eval() or directly from individual query argument names/values. The fallback path only excludes 4 reserved keys (type, limit, long, recursive).

2. Plugin routing (did_meta_plugins/__init__.py:227-248): Each filter key is checked via manages_key(). postgres_meta.manages_key() unconditionally returns True (line 345) — it accepts ANY filter key without validation.

3. FilterEngine initialization: The postgres_meta plugin instantiates FilterEngine with strict_coerce=False. Unknown keys pass through _coerce_filter_word_to_model_attribute() as raw strings.

4. Value typecasting (filter_engine.py:275-297): _try_typecast_string() attempts to parse the value as a boolean, datetime, or number. SQL injection strings fail all these parsers and are returned unchanged.

5. Sanity checks (filter_engine.py:149-190): _sanity_check_translated_filters() does not validate arbitrary key names or values for SQL-unsafe characters.

6. SQL construction (filter_engine.py:442-479): The unsanitized key and value strings are interpolated directly into raw SQL strings via .format().

7. SQL execution (postgres_meta.py:316,321): The raw string is wrapped in sql.SQL() (treated as trusted SQL) and executed via cur.execute().

PoC

Prerequisites:

  • A Rucio instance using PostgreSQL as the database backend
  • The postgres_meta metadata plugin explicitly configured (this is NOT the default — the default is json_meta)
  • Any valid Rucio authentication token (obtainable via userpass, x509, OIDC, SAML, SSH, or GSS)

1. Obtain an authentication token

```bash

TOKEN=$(curl -s -k \

-H 'X-Rucio-Account: testuser' \

-H 'X-Rucio-Username: testuser' \

-H 'X-Rucio-Password: testpass' \

'https://rucio.example.org/auth/userpass' \

-D - 2>/dev/null | grep -i 'x-rucio-auth-token' | awk '{print $2}' | tr -d '\r')

```

2. Value injection — boolean-based filter bypass

```bash

# postgres_meta uses create_postgres_query() -> raw string formatting

# filter_engine.py:477: "{}->>'{}' {} '{}'".format(jsonb_column,

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is low, an attacker needs low-level privileges on the target. No user interaction is required. Rated impact: confidentiality high, integrity high, availability high.

CVSS metrics in full

The score comes from this vector: CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H

  • Attack vector: Network — reachable from anywhere that can route to the service.
  • Attack complexity: Low — the attack works reliably, with no preparation.
  • Attack requirements: Present — the target has to be in a particular state for the attack to work.
  • Privileges required: Low — an ordinary user account is enough.
  • User interaction: None — nobody has to be tricked into anything.
  • Confidentiality impact: High — total loss, or loss the attacker controls.
  • Integrity impact: High — total loss, or loss the attacker controls.
  • Availability impact: High — total loss, or loss the attacker controls.

Weakness class

CVE-2026-29090 is classified as CWE-89: SQL Injection. Untrusted input is concatenated into an SQL statement, letting an attacker change the query and reach data the request should not return.

Affected software

CVE-2026-29090 is recorded against 1 package.

  • rucio (from 40.0.0 up to 40.1.1)

Timeline and source

Published on 6 May 2026 and last revised on 2 July 2026. No public exploit is currently recorded for this entry. Record sourced from OSV.

References

github.com (Web)
nvd.nist.gov (Advisory)
github.com (Advisory)
github.com (Web)
github.com (Package)
pypi.org (Web)

Other advisories for this package

rucio has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-89: SQL Injection) in other software:

Details

Severity CRITICAL
CVSS Score 9.5
CVSS Vector CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H
CWE CWE-89
Public Exploit ✅ No
Source OSV
Published 2026-05-06
Updated 2026-08-20
Modified 2026-07-02
Fix URL N/A

Affected Packages

Software From version Fixed in
rucio 40.0.0 40.1.1

Similar Threats

Exploit Protection

Are you running rucio?

CVE-2026-29090 carries CVSS 9.5 Critical rating. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.

Check My Site For CVE-2026-29090 →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2026
✓