PoC Archive PoC Archive
CVE-2026-110697 category: web CVSS 9.9 (CRITICAL)
Patched

Red Hat Quay Robot Listing SQL LIKE Wildcard — Cross-Tenant Robot Token Theft (CVE-2026-110697)

Published: 2026-11-25 • Researcher: googlesky (Lê Hiếu) — PoC/lab/write-up; discovered by Dave O'Connor (Red Hat); fix by Brandon Caton (Red Hat)

Target software Red Hat Quay / Project Quay (quay/quay) — robot account listing API
Affected versions All supported branches before the per-branch fix releases: 3.9.28, 3.10.28, 3.12.24, 3.14.10, 3.15.9, 3.16.7, 3.17.7, 3.18.3; public tag v3.18.2 verified vulnerable. NVD lists no CPE product/version ranges for this record — see references.
Status Weaponized
Severity Critical · CVSS 9.9
CVSS 9.9/10
Severity
Critical
CVE
CVE-2026-110697
Category
web
Affected product
Red Hat Quay / Project Quay (quay/quay) — robot account listing API
Affected versions
All supported branches before the per-branch fix releases: 3.9.28, 3.10.28, 3.12.24, 3.14.10, 3.15.9, 3.16.7, 3.17.7, 3.18.3; public tag v3.18.2 verified vulnerable. NVD lists no CPE product/version ranges for this record — see references.
Disclosed
2026-11-25
Patch status
Patched
On this page

Metadata

FieldValue
Date Added2026-11-25
Last Updated2026-11-19
Author / Researchergooglesky (Lê Hiếu) — PoC/lab/write-up; discovered by Dave O’Connor (Red Hat); fix by Brandon Caton (Red Hat)
CVE / AdvisoryCVE-2026-110697
Categoryweb
SeverityCritical
CVSS Score9.9 (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H)
StatusWeaponized
TagsQuay, container-registry, SQL-wildcard, LIKE-injection, CWE-89, cross-tenant, credential-theft, robot-tokens, authenticated, PostgreSQL
RelatedN/A

Affected Target

FieldValue
Software / SystemRed Hat Quay / Project Quay (quay/quay) — robot account listing API
Versions AffectedAll supported branches before the per-branch fix releases: 3.9.28, 3.10.28, 3.12.24, 3.14.10, 3.15.9, 3.16.7, 3.17.7, 3.18.3; public tag v3.18.2 verified vulnerable. NVD lists no CPE product/version ranges for this record — see references.
Language / PlatformPython (Flask API, Peewee ORM) with PostgreSQL 18 and Redis 8; Linux containers (Podman)
Authentication RequiredYes — any low-privileged account that can create a namespace (the attacker’s own user namespace is enough)
Network Access RequiredYes — HTTP/HTTPS to the Quay API and registry endpoints

Summary

Red Hat Quay constructs the SQL LIKE pattern used to list robot accounts directly from the caller’s own namespace name, without escaping SQL wildcard metacharacters. Any authenticated low-privileged user who can create a namespace can register one that differs from a victim namespace in a single character by substituting an underscore, which then matches the victim’s character in the database query. The listing endpoints return the victim’s robot accounts together with their decrypted authentication tokens, allowing cross-tenant credential theft and unauthorized image operations. The upstream PoC demonstrates the full chain: it steals a victim robot token, confirms it is byte-equal to the issued credential, and uses it to read and overwrite a private image tag in the victim tenant.

Vulnerability Details

Root Cause

Quay’s robot listing helper _list_entity_robots() in data/model/user.py builds a Peewee query whose ** operator compiles to a raw SQL LIKE/ILIKE:

Python
1
.where(User.robot == True, User.username ** (entity_name + "+%"))

entity_name is the caller’s own namespace name (user or organization), taken verbatim and concatenated with the literal wildcard tail +%. Quay’s username validation permits interior underscores (^([a-z0-9]+(?:[._-][a-z0-9]+)*)$), so an underscore in the attacker-controlled prefix reaches PostgreSQL unescaped and acts as a single-character wildcard. A victim namespace abxc with robot abxc+bot is therefore matched by the attacker’s pattern ab_c+%. The same query inner-joins RobotAccountToken, and endpoints/api/robot_models_pre_oci.py decrypts every matched token row before the API serializes it — the decryption is the sink. The upstream fix replaces the raw operator with prefix_search(User.username, entity_name + "+"), which escapes ! % _ [ and compiles with SQL ESCAPE '!'.

Attack Vector

Authenticated, low-privileged HTTP requests. The attacker registers a user or organization whose namespace collides with the victim’s, then calls:

  • GET /api/v1/user/robots?token=true (the attacker’s own user namespace), or
  • GET /api/v1/organization/<attacker-org>/robots?token=true (an organization the attacker administers).

Both responses include the victim’s colliding robots with decrypted tokens because token=true is the default. The same flawed helper is also reached by two second-order paths covered by the identical fix: change_username() (renaming the attacker’s underscore account rewrites the victim’s robot identity cross-tenant) and delete_user() (namespace deletion can delete the matched robots). Unauthenticated access returns HTTP 401, so a valid account and the ability to create a namespace are required.

Impact

Cross-tenant theft of robot account credentials — the long-lived tokens CI/CD pipelines use to pull and push images. With a stolen token the attacker can authenticate to the Docker registry v2 API, list the victim’s private repositories, read images, and overwrite tags, which converts into a software supply-chain compromise inside the victim tenant (CVSS scope changed, Confidentiality/Integrity/Availability High). The upstream lab captured the full impact: GET /v2/ with the stolen credential returned HTTP 200, tags/list on the victim’s private repository returned HTTP 200, and a manifest overwrite returned HTTP 201 with the victim then serving the attacker’s content.

Environment / Lab Setup

Output
OS:          Linux x86_64 with rootless Podman and a running podman socket
Target:      Two identical Quay stacks built from quay/quay:
             quay-vuln  @ 094cfb0^ (fix parent — vulnerable)
             quay-fixed @ 094cfb0  (fix commit)
             each with PostgreSQL 18 and Redis 8 on an isolated Podman network
Attacker:    Any authenticated low-privileged Quay account able to create a namespace
Tools:       Podman, Python 3.12 (stdlib only), make
Resources:   ~20 GB free disk for the two Quay builds; containers bounded to
             2 CPUs / 4 GB memory (database 1 CPU / 1 GB)
Config:      AUTHENTICATION_TYPE: Database, FEATURE_USER_CREATION: true,
             FEATURE_USER_RENAME: true, SETUP_COMPLETE: true

Setup Steps

Shell script
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
make build        # clone quay/quay at 094cfb0^ and 094cfb0, build both images
make up           # postgres + redis + quay for both sides, wait for health
make poc-image    # build the stdlib-only PoC runner image

make sqlprobe
./lab/run-lab.sh instrument-db && make check && ./lab/run-lab.sh dbquery

make check        # non-destructive self-collision probe (no foreign tenant touched)
make exploit      # full chain: theft + stolen-credential use against the vulnerable side
make exploit-fixed   # negative control against the fixed stack
make probe        # second impact: cross-tenant robot rename
make mitigation   # validates the published mitigations
make down         # teardown

Note: the two Quay images are built from upstream source at the two commits and are identical except for the fix; lab/src/ is intentionally not archived (about 20 GB of GitHub checkout plus images), so make build fetches it from quay/quay.

Proof of Concept

Step-by-Step Reproduction

  1. Start the differential lab — make build && make up && make poc-image brings up the vulnerable and fixed Quay stacks on the dedicated network cve-2026-110697-net, each with its own PostgreSQL and Redis.
  2. Create the colliding identities — make exploit registers a victim user vicx<suffix> and an attacker user vi_x<suffix> (same name with the third character replaced by an underscore); the suffix is random per run.
  3. Seed the victim tenant — the victim creates a user-namespace robot vicx<suffix>+probe, an organization vorgx<suffix> with an org robot, a private repository, and pushes a benign 1.0 tag with the legitimate robot credential.
  4. Trigger the wildcard match — the attacker lists its own robots via GET /api/v1/user/robots?token=true and GET /api/v1/organization/vo_gx<suffix>/robots?token=true. Both responses contain the victim’s robots with decrypted tokens.
  5. Confirm token theft — the script byte-compares each stolen token with the token Quay issued to the victim and records True.
  6. Abuse the stolen credential — it authenticates to /v2/ with the stolen robot name and token (HTTP 200), lists the victim’s private repository tags (HTTP 200), and overwrites the victim’s 1.0 manifest (HTTP 201); the victim-side read then shows the attacker marker.
  7. Verify the fix — the same commands against quay-fixed return empty listings, no token, and no registry access (see evidence/run-fixed-exploit.log).

Exploit Code

See exploit/exploit.py for the standalone full-chain exploit and poc/poc.py for the equivalent check / exploit / probe / mitigation modes (both stdlib-only Python 3, no third-party packages). The SQL-pattern differential lives in lab/sqlprobe.py. Captured runs are in evidence/.

The core primitive, from lab/sqlprobe.py (the shape the PoC exercises):

Python
1
#

The HTTP primitive, distilled:

Python
1
2
GET /api/v1/organization/ab_c/robots?token=true
GET /v2/  with Basic auth "abxc+bot:<stolen-token>"   -> HTTP 200

Expected Output

From the captured vulnerable run (evidence/run-vuln-exploit.log):

Output
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
[*] victim user vicxebi5uyci | attacker user vi_xebi5uyci
[*] attacker lists own user robots (GET /api/v1/user/robots?token=true)
[*] returned: ['vicxebi5uyci+probe']
[*] attacker lists own org robots (GET /api/v1/organization/vo_gxebi5uyci/robots?token=true)
[*] returned: ['vorgxebi5uyci+probe']
[!] CROSS-TENANT TOKEN THEFT (org robots): vorgxebi5uyci+probe
[!]   byte-equal to the token Quay issued to the victim: True
[!] CROSS-TENANT TOKEN THEFT (user robots): vicxebi5uyci+probe
[*] GET /v2/ with the STOLEN robot credentials -> HTTP 200
[*] GET /v2/vorgxebi5uyci/appebi5uyci/tags/list with the STOLEN creds -> HTTP 200 tags=['1.0']
[!] manifest overwrite of the victim's tag 1.0 with the stolen creds -> HTTP 201
[*] victim-side view of tag 1.0 now contains attacker content: True (HTTP 200)
FINDING: CVE-2026-110697 confirmed — decrypted cross-tenant robot token stolen and used

The fixed build (evidence/run-fixed-exploit.log) returns [] for both listings and exits 0 (RESULT: fixed/clean build).

Detection & Indicators of Compromise

  • PostgreSQL log_statement='all' / pgaudit records a robot listing query whose bound pattern contains an underscore and no ESCAPE clause, e.g. WHERE (("t1"."robot" = true) AND ("t1"."username" ILIKE 'vi_x…+%')) joining robotaccounttoken. The fixed build emits ILIKE 'vi!_x…+%' ESCAPE '!'.
  • Quay API access logs showing GET /api/v1/user/robots?token=true or GET /api/v1/organization/<name>/robots?token=true from accounts whose own namespace contains an interior underscore, especially immediately after account/org creation.
  • One Quay account returning robot names prefixed with a namespace the account does not own.
  • Registry audit events: GET /v2/<other-namespace>/<repo>/tags/list and manifest PUT/overwrite (HTTP 201) by a robot whose owning namespace does not match the repository namespace.
  • Subsequent robot token regeneration or unexpected change_username / namespace-deletion activity touching foreign robots (second-order paths).
  • Anonymous self-service signups immediately creating underscore-named organizations (the precondition for the collision).

Example PostgreSQL log signature:

Output
1
2
3
4
LOG:  statement: SELECT ... FROM "user" AS "t1"
      LEFT OUTER JOIN "robotaccountmetadata" AS "t3" ...
      INNER JOIN "robotaccounttoken" AS "t2" ...
      WHERE (("t1"."robot" = true) AND ("t1"."username" ILIKE 'ch_xs1cqq5w0+%'))

SIEM / IDS rule (example):

Output
1
2
3
4
5
6
7
8
alert http any any -> any any (msg:"Quay robot listing with underscore-wildcard namespace";
  flow:to_server,established;
  content:"GET"; http_method;
  content:"/api/v1/"; http_uri;
  content:"/robots"; http_uri;
  content:"token=true"; http_uri;
  pcre:"/\/api\/v1\/(user|organization\/[a-z0-9._-]*_[a-z0-9._-]*)\/robots/";
  sid:9069697;)

Remediation

ActionDetail
PatchUpgrade Red Hat Quay to 3.9.28, 3.10.28, 3.12.24, 3.14.10, 3.15.9, 3.16.7, 3.17.7, 3.18.3 or later, which contain quay/quay commit 094cfb0 (“Fix CVE-2026-110697 and CVE-2026-123710”); the hunk swaps the raw ** LIKE for prefix_search() with ESCAPE '!' and covers both branches and every caller.
WorkaroundRotating robot tokens revokes an already-stolen token but does not stop re-theft: the lab’s mitigation mode shows the same collision immediately steals the rotated token, so rotation is only partial. Restrict who can create namespaces/accounts and audit existing underscore-named namespaces for foreign robot references until the upgrade lands.
Config HardeningDisable self-service creation where possible (FEATURE_USER_CREATION), apply a namespace naming policy that rejects interior underscores (compensating control, not a code fix), enforce least-privilege robot scopes and short-lived credentials, monitor robot listing endpoints and registry manifest overwrites, and alert on cross-namespace robot names returned to a caller.

References

Notes

Auto-ingested from https://github.com/googlesky/CVE-2026-110697 on 2026-11-25.

Review verdict: this is a genuine, working full-chain PoC — not a detector, scanner or audit tool. It registers fixtures, performs the wildcard collision, steals and byte-compares the decrypted victim tokens, and then uses the stolen credential against the registry API to read and overwrite the victim’s private image tag. Status is therefore “Weaponized” rather than “PoC”. The repository also ships a differential lab (vulnerable 094cfb0^ vs fixed 094cfb0) and captured evidence, both archived here.

License: MIT (Copyright 2026 Lê Hiếu), full text in LICENSE; attribution retained in upstream-README.md. Files were copied verbatim from upstream except for a two-line authorized-research header added to exploit/exploit.py and poc/poc.py; lab/src/ (upstream Quay checkout), .git, container images and the upstream CITATION.cff/SECURITY.md/additional evidence logs were not copied.

Limitations: the attack requires an authenticated low-privileged account and the ability to create a namespace (the lab enables anonymous signup and user rename on purpose); it is not pre-auth. The exploit mode’s overwrite step is destructive by design and must only run against disposable, owned lab instances — it was NOT executed during ingestion, and no exploit code was run. NVD has no CPE product/version ranges for this record, so the affected-version list comes from the vendor fix releases and the upstream README, with tag v3.18.2 independently verified by the researcher. Building the full differential lab needs roughly 20 GB of disk, rootless Podman and network access to fetch upstream images and source; the captured evidence is included so the result can be reviewed without rebuilding. The two archived lab/config/*/config.yaml files contain the upstream repository’s fixed, disposable DATABASE_SECRET_KEY used only by the throwaway lab containers (not a production credential); it is retained so the encrypted robot-token behavior can be reproduced faithfully.