
Proof-of-concept and containerized differential lab for CVE-2026-110697, an unescaped SQL LIKE wildcard in Red Hat Quay robot listing that leaks cross-tenant robot tokens.
Published at: https://github.com/googlesky/CVE-2026-110697 (public repository; lab, PoC, write-up and captured evidence).
PoC, containerized differential lab, and root-cause analysis for CVE-2026-110697
(CVSS 3.1 9.9 CRITICAL, CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H),
a tenant-isolation failure in Red Hat Quay / Project Quay caused by an
unescaped SQL LIKE wildcard in the robot account listing function
(Red Hat advisory,
NVD record). Discovered by
Dave O'Connor (Red Hat).
| Component | Red Hat Quay / Project Quay (quay/quay), robot account listing API |
| Affected | all supported Quay branches before the fix — fixed in 3.9.28, 3.10.28, 3.12.24, 3.14.10, 3.15.9, 3.16.7, 3.17.7, 3.18.3 (Quay.io SaaS already fixed) |
| Fixed by | quay/quay commit 094cfb0 — "Fix CVE-2026-110697 and CVE-2026-123710 (#8056)" (2026-11-11, author Brandon Caton, Red Hat) |
| CWE | CWE-89 (improper neutralization of special elements used in an SQL command — LIKE wildcard) |
| Impact | cross-tenant credential theft: another tenant's robot accounts and decrypted authentication tokens; stolen credentials operate the victim's image read/push/overwrite (CI/CD supply-chain impact) |
| Vector | authenticated, low-privileged: any account that can create a namespace (its own user namespace is enough); no admin rights, no victim interaction |
| Trigger | create a namespace whose name differs from the victim's namespace in exactly one character, replaced by _; list "own" robots |
An authenticated attacker creates a namespace (or registers a username) whose name
contains an underscore at the position where it should match the victim's
namespace character. The robot listing endpoint builds LIKE '<attacker-ns>+%_'
from the attacker's own namespace without escaping, so the _ absorbs the victim
namespace's character and the query returns the victim's robot accounts together
with their decrypted tokens. Robot tokens are the credentials CI/CD pipelines use
to push and pull images, so the theft converts directly into unauthorized image
overwrite inside the victim tenant — the impact Red Hat rates at 9.9.
data/model/user.py, _list_entity_robots() (vulnerable tree — tag v3.18.2
line 634, and master 094cfb0^ line 796):
def _list_entity_robots(entity_name, include_metadata=True, include_token=True):
...
if include_metadata or include_token:
query = (
User.select(User, RobotAccountToken, RobotAccountMetadata)
.join(RobotAccountMetadata, JOIN.LEFT_OUTER)
.switch(User)
.join(RobotAccountToken) # <-- encrypted token joined in
.where(User.robot == True, User.username ** (entity_name + "+%"))
)
In peewee, ** compiles to a raw LIKE/ILIKE (Quay binds it as ILIKE on
PostgreSQL, see evidence/sqlprobe-vuln.txt). entity_name is the caller's own
namespace name, taken verbatim from the authenticated user's account or
organization and concatenated with +%:
_ — single-character wildcard (the character Quay itself allows inside
usernames: VALID_USERNAME_REGEX = ^([a-z0-9]+(?:[._-][a-z0-9]+)*)$,
util/validation.py);% — multi-character wildcard (fixed literal at the end of the pattern).The decrypted-token sink sits one frame up:
endpoints/api/robot_models_pre_oci.py calls .decrypt() on every matched
RobotAccountToken row, and endpoints/api/robot.py robots_list() serializes
them into the response (token=true is the default on both endpoints).
The collision arithmetic: victim namespace N, attacker namespace A where A is
N with one interior character replaced by _. The API-generated pattern is
A + "+%"; the victim's robot username is N + "+" + shortname; the _ matches
the victim character, every other position matches literally:
victim org : abxc robot username: abxc+bot
attacker org : ab_c LIKE pattern : ab_c+%
ab_c+%
abxc+bot -> MATCH (foreign tenant)
Reachable API endpoints in the vulnerable tree:
| Endpoint | Prefix source | Permission required | Returns |
|---|---|---|---|
GET /api/v1/user/robots?token=true | authenticated user's own username | any logged-in user | own + colliding foreign robots + decrypted tokens |
GET /api/v1/organization/<orgname>/robots?token=true | the caller's own organization name | org member (attacker is admin of the colliding org they created) | own + colliding foreign robots + decrypted tokens |
The same flawed query also powers two second-order paths, both covered by the same
fix: change_username() (data/model/user.py:302) renames every robot the wildcard
matches — so renaming the attacker's own underscore username renames the victim's
robot cross-tenant (probe mode demonstrates it), and namespace deletion
(delete_user(), data/model/user.py:1730) deletes them.
Upstream fix (commit 094cfb0, data/model/user.py):
- .where(User.robot == True, User.username ** (entity_name + "+%"))
+ .where(User.robot == True, prefix_search(User.username, entity_name + "+"))
prefix_search() (data/text.py) escapes ! % _ [ and compiles the pattern with
SQL ESCAPE '!', which turns the underscore back into a literal character. The fix
hunk covers both branches of _list_entity_robots(), and every caller
(list_namespace_robots, list_entity_robot_permission_teams, change_username,
delete_user) inherits it. Upstream added the regression test
test_list_namespace_robots_underscore_namespace_exact_match with exactly the
collision shape this PoC implements (ab_c vs abxc).
Two identical Quay stacks that differ only in the target component
(the fix commit), each with its own PostgreSQL and Redis, on a dedicated Podman
network cve-2026-110697-net:
| Container | Image | Source |
|---|---|---|
quay-vuln | cve-2026-110697:vuln | quay/quay @ 094cfb0^ (fix parent — vulnerable) |
quay-fixed | cve-2026-110697:fixed | quay/quay @ 094cfb0 (fix commit) |
quay-db-{vuln,fixed} | postgres:18 | per-side database |
quay-redis-{vuln,fixed} | redis:8 | per-side ephemeral store |
Dockerfile (target final,
BUILD_ANGULAR=false — the UI bundle is not needed for the API PoC). Identical
base image, Python requirements, and config; the only delta is the fix commit.
Exact commits, image digests and the supporting-image digests are recorded in
evidence/versions.txt.lab/sqlprobe.py runs inside both containers
against identical seeded data and prints the modelled query (see below), and the
instrumented database build (./lab/run-lab.sh instrument-db, then any PoC
mode, then ./lab/run-lab.sh dbquery) switches PostgreSQL to
log_statement='all' so the evidence records the SQL the database actually
executed on each side — see evidence/dbquery-vuln.txt /
evidence/dbquery-fixed.txt. Both prove the malformed pattern and the
foreign-tenant match on the vulnerable build, and the escaped pattern plus
exact-only match on the fixed build.--cpus 2 --memory 4g).