/

CVE-2026-23696

Severity:

CRITICAL RISK

(9.9)

SQL Injection in Windmill Folder Ownership Management

CVE-2026-23696

Awaiting Analysis

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Authentication Bypass and Remote Code Execution via SQL Injection

Severity:

CRITICAL RISK

(9.9)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Windmill CE and EE between versions 1.276.0 and 1.603.2 contain an SQL injection vulnerability in the folder ownership management feature, where the owner parameter is unsafely incorporated into database queries.

Authenticated attackers can inject SQL to read sensitive data such as the JWT signing secret and admin identifiers, then forge administrative tokens to ultimately execute arbitrary code via workflow execution endpoints.

Affected context

This vulnerability appears in Windmill's folder ownership management functionality, specifically where changes to folder owners are processed on the server side.

It manifests when:

  • User-controlled owner values are accepted from authenticated sessions,
  • These values are used directly in SQL statements without strict parameterization or safe query construction,
  • The database contains security-sensitive configuration and identity data (e.g., JWT signing secrets, administrative user records),
  • Workflow execution endpoints can trigger arbitrary code or system actions when invoked with valid administrative authorization.

Exploit preconditions

  • Attack surface: HTTP endpoints that handle folder ownership changes (e.g., APIs or UI-backed routes).
  • Required access: Valid authenticated Windmill account; no administrative role is strictly required if the vulnerable endpoint is accessible to lower-privileged users.
  • User-controlled parameter: The owner field used in folder ownership management requests.
  • Trigger point: Server-side logic that builds and executes SQL queries incorporating the owner parameter.
  • Why exploitation is possible: Input from the owner parameter is concatenated or interpolated into SQL queries without adequate parameter binding, escaping, or query abstraction, allowing crafted input to alter the intended SQL structure and access arbitrary data.

Why this happens

The underlying issue is an SQL injection flaw, aligning with CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').

Instead of using parameterized queries or a query builder that separates code from data, the folder ownership logic appears to:

  • Treat the owner parameter as trusted,
  • Interpolate it directly into SQL or rely on inadequate sanitization,
  • Execute the resulting query with database privileges sufficient to read sensitive system tables or configuration data.

This pattern allows attacker-controlled input to modify WHERE clauses, union in additional queries, or otherwise bypass access controls at the database layer, leading to exposure of secrets (like JWT signing keys) and administrative identifiers that can be abused for privilege escalation.

Potential impact

  • Exposure of JWT signing secrets, enabling attackers to forge valid application tokens.
  • Enumeration and theft of administrative user identifiers and other sensitive account data.
  • Creation of forged administrative JWTs, effectively bypassing role-based access controls.
  • Remote execution of arbitrary code or workflows via privileged workflow execution endpoints.
  • Unauthorized access to additional sensitive database tables, including configuration, logs, or user data.
  • Lateral movement within the application environment by abusing high-privilege workflows.

General mitigation guidance

Effective mitigation focuses on eliminating direct SQL injection vectors and reducing the blast radius of any single query:

  • Prefer parameterized queries / prepared statements or ORM-based query builders for all interactions involving user-controlled fields such as owner.
  • Treat all request parameters, even from authenticated users, as untrusted, and avoid string concatenation or templated SQL query construction.
  • Enforce strict input validation and normalization on identifiers like owner (e.g., enforce UUID, numeric ID, or validated username formats instead of arbitrary strings).
  • Restrict database accounts used by the application to least-privilege, limiting access to only the tables and operations required for folder ownership management.
  • Consider segregating secrets and critical configuration (like JWT signing keys) in dedicated secret stores or isolated tables/services not directly accessible from routine application queries.
  • Implement robust authorization checks at the application layer to ensure that only appropriately privileged users can change folder ownership, independent of database-level filtering.

How teams detect issues like this

Detection approaches can combine code-centric and runtime techniques:

  • Static analysis: Use rules that flag dynamic SQL built from request parameters (e.g., concatenation or f-strings with owner or similar fields). Look for raw SQL execution APIs without bound parameters.
  • Code review: During manual reviews, treat any occurrence of string-based query construction, especially around access control or ownership changes, as a high-risk hotspot that requires parameterization and validation.
  • Security testing: Apply focused SQL injection tests against folder-related endpoints in QA and staging, using automated DAST tools or targeted manual tests to identify injectable parameters.
  • Logging and monitoring: Monitor for abnormal SQL patterns (e.g., unexpected UNION, OR 1=1, or wide table scans) and unusual access to configuration or secret-related tables originating from ownership-related requests.
  • Policy enforcement: Integrate linting or CI checks that prohibit unparameterized SQL execution patterns in application code and enforce ORM or query-builder usage where possible.

Sources

SourceLink
apps.nextcloud.comapps.nextcloud.com/apps/flow/releases
chocapikk.comchocapikk.com/posts/2026/windfall-nextcloud-flow-windmill-rce/
github.comgithub.com/Chocapikk/Windfall
github.comgithub.com/windmill-labs/windmill/commit/942fb629210ebb287f48467d1535ffde3a3eeafe
github.comgithub.com/windmill-labs/windmill/releases/tag/v1.603.3
vulncheck.comvulncheck.com/advisories/windmill-file-ownership-handling-sqli-rce
windmill.devwindmill.dev/

Frequently asked

questions

It is remotely exploitable through the web/API interface, provided the attacker can authenticate to the Windmill instance and reach the folder ownership management endpoint.

Not necessarily. The vulnerability resides in an authenticated endpoint; if non-admin or low-privilege accounts can invoke it, those accounts may be sufficient to perform SQL injection and escalate to administrative control.

Replace any string-built SQL in the folder ownership logic with parameterized queries or ORM-based operations, validate the owner parameter as a strict identifier type, and ensure the database user used by that code has only the minimal privileges required.

Adopt a development standard that forbids unparameterized SQL, enforce use of safe database access abstractions, integrate static analysis and security testing into CI/CD, and regularly review high-risk paths such as authentication, authorization, and configuration management for unsafe query patterns.

Find out what's already
exploitable in your codebase.