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)
- 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
Tags
References
- https://nvd.nist.gov/vuln/detail/CVE-2026-110697
- https://access.redhat.com/security/cve/cve-2026-110697
- https://access.redhat.com/errata/RHSA-2026:100818
- https://access.redhat.com/errata/RHSA-2026:99019
- https://access.redhat.com/errata/RHSA-2026:99021
- https://access.redhat.com/errata/RHEA-2026:102634
- https://github.com/googlesky/CVE-2026-110697
- https://github.com/quay/quay/commit/094cfb024f01401c1c2cca616a22325d71b4e7be
- https://github.com/quay/quay/releases/tag/v3.18.2
- https://access.redhat.com/security/cve/cve-2026-123710
Archive entry
intelseclab/poc-archiveOn this page
Metadata
| Field | Value |
|---|---|
| Date Added | 2026-11-25 |
| Last Updated | 2026-11-19 |
| Author / Researcher | googlesky (Lê Hiếu) — PoC/lab/write-up; discovered by Dave O’Connor (Red Hat); fix by Brandon Caton (Red Hat) |
| CVE / Advisory | CVE-2026-110697 |
| Category | web |
| Severity | Critical |
| CVSS Score | 9.9 (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H) |
| Status | Weaponized |
| Tags | Quay, container-registry, SQL-wildcard, LIKE-injection, CWE-89, cross-tenant, credential-theft, robot-tokens, authenticated, PostgreSQL |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | Red Hat Quay / Project Quay (quay/quay) — robot account listing API |
| Versions Affected | 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. |
| Language / Platform | Python (Flask API, Peewee ORM) with PostgreSQL 18 and Redis 8; Linux containers (Podman) |
| Authentication Required | Yes — any low-privileged account that can create a namespace (the attacker’s own user namespace is enough) |
| Network Access Required | Yes — 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:
| |
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), orGET /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
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: trueSetup Steps
| |
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
- Start the differential lab —
make build && make up && make poc-imagebrings up the vulnerable and fixed Quay stacks on the dedicated networkcve-2026-110697-net, each with its own PostgreSQL and Redis. - Create the colliding identities —
make exploitregisters a victim uservicx<suffix>and an attacker uservi_x<suffix>(same name with the third character replaced by an underscore); the suffix is random per run. - Seed the victim tenant — the victim creates a user-namespace robot
vicx<suffix>+probe, an organizationvorgx<suffix>with an org robot, a private repository, and pushes a benign1.0tag with the legitimate robot credential. - Trigger the wildcard match — the attacker lists its own robots via
GET /api/v1/user/robots?token=trueandGET /api/v1/organization/vo_gx<suffix>/robots?token=true. Both responses contain the victim’s robots with decrypted tokens. - Confirm token theft — the script byte-compares each stolen token with the token Quay issued to the victim and records
True. - 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’s1.0manifest (HTTP 201); the victim-side read then shows the attacker marker. - Verify the fix — the same commands against
quay-fixedreturn empty listings, no token, and no registry access (seeevidence/run-fixed-exploit.log).
Exploit Code
See
exploit/exploit.pyfor the standalone full-chain exploit andpoc/poc.pyfor the equivalentcheck/exploit/probe/mitigationmodes (both stdlib-only Python 3, no third-party packages). The SQL-pattern differential lives inlab/sqlprobe.py. Captured runs are inevidence/.
The core primitive, from lab/sqlprobe.py (the shape the PoC exercises):
| |
The HTTP primitive, distilled:
| |
Expected Output
From the captured vulnerable run (evidence/run-vuln-exploit.log):
| |
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 noESCAPEclause, e.g.WHERE (("t1"."robot" = true) AND ("t1"."username" ILIKE 'vi_x…+%'))joiningrobotaccounttoken. The fixed build emitsILIKE 'vi!_x…+%' ESCAPE '!'. - Quay API access logs showing
GET /api/v1/user/robots?token=trueorGET /api/v1/organization/<name>/robots?token=truefrom 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/listand manifestPUT/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:
| |
SIEM / IDS rule (example):
| |
Remediation
| Action | Detail |
|---|---|
| Patch | Upgrade 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. |
| Workaround | Rotating 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 Hardening | Disable 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
- CVE-2026-110697 — NVD
- CVE-2026-110697 — Red Hat CVE database
- Red Hat errata RHSA-2026:100818
- Red Hat errata RHSA-2026:99019
- Red Hat errata RHSA-2026:99021
- Red Hat errata RHEA-2026:102634
- googlesky/CVE-2026-110697 — source PoC, lab and write-up
- quay/quay fix commit 094cfb0
- quay/quay v3.18.2 — affected release tag
- Sibling advisory CVE-2026-123710 — Quay keyserver service-key lifecycle validation (same fix commit)
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.