//nefariousplan

CVE-2026-29059: Windmill Patched The Handler. Postgres Filenode 17149 Is Still At 17149.

vendor

patterns

cve

proof of concept

async fn get_log_file(Path((_w_id, file_p)): Path<(String, String)>) -> error::Result<Response> {
    let local_file = format!("{TMP_DIR}/logs/{file_p}");
    if tokio::fs::metadata(&local_file).await.is_ok() {
        let mut file = tokio::fs::File::open(local_file).await.map_err(to_anyhow)?;

Four lines. No .. check. No workspace check. The _w_id argument starts with an underscore, which is Rust's convention for "I am binding this name but I am not going to use it." The handler accepts a workspace ID and then discards it. CVE-2026-29059 is what those four lines do when file_p is ../../../../../etc/passwd.

async fn get_log_file(Path((_w_id, file_p)): Path<(String, String)>) -> error::Result<Response> {
    let local_file = format!("{TMP_DIR}/logs/{file_p}");
    if tokio::fs::metadata(&local_file).await.is_ok() {
        let mut file = tokio::fs::File::open(local_file).await.map_err(to_anyhow)?;

Four lines. No .. check. No workspace check. The _w_id argument starts with an underscore, which is Rust's convention for "I am binding this name but I am not going to use it." The handler accepts a workspace ID and then discards it. CVE-2026-29059 is what those four lines do when file_p is ../../../../../etc/passwd.

The defendant in this matter is Windmill, an open-source developer platform that compiles scripts into background jobs, persists their logs to disk, and serves those logs back over HTTP. The perpetrator is a handler that was wired into the unauthenticated read subtree, accepted a free-form path component, and called tokio::fs::File::open on that component without ever asking whether the caller was permitted to read it. The handler lived in backend/windmill-api/src/jobs.rs. The route lived at /api/w/:workspace_id/jobs_u/get_log_file/{*file_path}. It was reachable by any HTTP client that could speak to the API surface.

The pre-patch handler had no checks. The patch added four.

The patch shipped in Windmill v1.603.3 across two commits: 05285ca81 ("tighten get_log_file") and the follow-up 942fb6292 ("nit tightening"). The diff against the four-line handler quoted above adds string-level checks before the open.

if file_p.contains("..") {
    return Err(error::Error::BadRequest("bad path".to_string()));
}
let parts: Vec<&str> = file_p.split('/').collect();
if parts.len() != 2 {
    return Err(error::Error::BadRequest("bad path".to_string()));
}
let _uuid = uuid::Uuid::parse_str(parts[0])
    .map_err(|_| error::Error::BadRequest("bad uuid".to_string()))?;
if !parts[1].ends_with(".txt") {
    return Err(error::Error::BadRequest("bad ext".to_string()));
}

Four checks. The string must not contain ... The string must split into exactly two parts on /. The first part must parse as a UUID. The second part must end with .txt. After all four checks pass, the handler does exactly what it did before: format!("{TMP_DIR}/logs/{file_p}"), tokio::fs::metadata, tokio::fs::File::open.

What the patch does not add: authentication. The handler remains inside the jobs_u router subtree. The _w_id underscore is still there. The workspace argument is still parsed off the URL and still discarded. The contract of the endpoint, "any HTTP client may read this file by name," is preserved. The patch narrowed the set of names. It did not narrow the set of clients.

A later commit on master, 89a7a37 (PR #9416), added a job-ownership check and a symlink guard. That commit did not ship in the CVE-fix release. The CVE-fix release shipped the four string checks and called the bug closed. The four string checks are what the defender's bench has to work with.

The CVE title says "rarely used." The PoC ships three paths to root.

The MITRE record for CVE-2026-29059 describes the vulnerable surface as a "rarely used" Nextcloud Flow integration. The published proof-of-concept disagrees with the record on a point of fact. The PoC ships a Nuclei template. The template requests:

GET /api/w/_/jobs_u/get_log_file/..%2F..%2F..%2F..%2F..%2F..%2Fetc%2Fpasswd

The path /api/w/_/jobs_u/get_log_file/... exists on every default Windmill deployment, not only on deployments that have enabled the Nextcloud Flow packaging. The workspace ID _ is the documented Windmill wildcard. The Nuclei template asks for /etc/passwd as a sanity check. The post-exploitation steps in the PoC walk past /etc/passwd to three files that matter.

Path one: SUPERADMIN_SECRET. The Windmill server reads a cluster-wide signing key out of the environment at boot and persists a copy to a predictable path inside the container so workers can JWT-sign their callbacks. The file is plaintext. The path is predictable. Read it, mint a JWT that names any user in any workspace, and the cluster's authentication surface no longer has a meaningful interior. The handler that exposed /etc/passwd also exposes this file.

Path two: the Nextcloud Flow JSON config. Nextcloud Flow ships Windmill as a packaged Nextcloud application. The packaging puts a JSON config at a predictable path inside the app directory. The config contains the database password in plaintext, because that is what packaging-for-non-technical-operators looks like. Read the config, connect to Postgres as the application user, exfiltrate the password table directly. This is the "rarely used" path. It is also the path where the CVE title is honest, because Nextcloud Flow is the integration that ships the database password as a static file. The path is real. The PoC walks it. The CVE title softens it.

Path three: the Postgres filenode. Postgres stores each table as one or more files on disk, in base/<database_oid>/<filenode>. The filenode number is assigned at CREATE TABLE time and persists across vacuum, analyze, and restart. Windmill's migrations create tables in a deterministic order. The filenodes are therefore deterministic across deployments of the same Windmill version. The PoC ships the numbers.

PG_FILENODES = {
    'global_settings': 17149,
    'password':        16815,
    'token':           16564,
    'resource':        16626,
    'usr':             16504,
}

The handler that exposed /etc/passwd also exposes base/<db_oid>/17149. The global_settings table contains the cluster-wide SUPERADMIN_SECRET row. The password table at 16815 contains every user's password hash. The token table at 16564 contains every active session token in plaintext. The handler does not know that filenode 17149 is interesting. The handler does not need to know.

The CVE title says "rarely used." The PoC ships three paths. Two are default-deployment paths. The "rarely used" softener applies to one path out of three, and it is the path where reading the file directly out of the application's own config is the least interesting of the three escalation vectors.

The _u is honest. The handler kept the promise.

The URL prefix jobs_u is documented as the unauthenticated subtree. It is wired in backend/windmill-api/src/lib.rs:

.nest(
    "/w/:workspace_id/jobs_u",
    jobs::workspace_unauthed_service().layer(cors.clone()),
)

The route table inside workspace_unauthed_service registers twelve read endpoints. The scope table at backend/windmill-api/src/scopes.rs enumerates them as RUN_WHITELISTED_GET_PATHS for the run-jobs scope, and the list under the jobs_u/ prefix reads: get_flow, get_root_job_id, get, get_logs, get_args, get_flow_debug_info, completed/get, completed/get_result, completed/get_result_maybe, getupdate, getupdate_sse, get_log_file. Twelve endpoints, all GET, all unauthenticated by design.

The reason these endpoints are unauthenticated is that Windmill's webhook model expects external callers to poll for job completion by job ID. The job ID is a 128-bit UUID. The assumption is that knowing the UUID is itself the access control. The siblings of get_log_file honor this contract: get_logs takes a job ID, looks the job up in the database, returns the log content from the row. The UUID is opaque, the database lookup is parameterized, and the unauthenticated-by-UUID design holds.

get_log_file does not honor the contract. The handler does not take a job ID. The handler takes a free-form path component, joins it onto TMP_DIR/logs/, and opens the result. The UUID-as-access-control assumption breaks the moment the path component stops being a UUID. The pre-patch handler had no check that the path component was a UUID. The pre-patch handler had no check that the path component did not contain ... The pre-patch handler had no check that the resolved path stayed inside TMP_DIR/logs/.

The four checks added by the patch enforce a subset of what the surrounding architecture promised. They check that the path looks like <uuid>/<name>.txt. They reject ... They do not canonicalize. They do not stat the resolved path and compare its parent against TMP_DIR/logs/. They do not chase symlinks. The symlink guard came later, on master, in PR #9416. The CVE-fix release shipped without it.

The _u in jobs_u is honest about what the subtree does. It serves unauthenticated reads. The handler is the part that lied. The handler claimed to serve unauthenticated reads of log files keyed by UUID, and in fact served unauthenticated reads of arbitrary paths under TMP_DIR, which on a default container layout shares a root with the application's config, the application's secrets, and the application's database files.

The four checks do not move the file.

The patch closes the path-traversal primitive at this endpoint. The patch does not move global_settings off filenode 17149. The patch does not move SUPERADMIN_SECRET off the addressable on-disk path where the worker bootstrap put it. The patch does not move the Nextcloud Flow JSON config off the predictable Nextcloud app directory. The patch closed the file read. It did not move the file.

The substrate that made this CVE a full cluster compromise has not changed. Eleven other jobs_u read endpoints remain unauthenticated by design. A future bug in any of them that touches the filesystem reaches the same files. A future bug in any handler anywhere in the codebase that calls tokio::fs::File::open on an attacker-controlled path reaches the same files. A future bug in any deserializer that follows a path string out of a config blob reaches the same files. The disk layout is the asset. The handler was the access road.

This is the Design Debt Driver pattern, documented in the nefariousplan catalog at one hundred eight prior exhibits and counting. The substrate (a router subtree that is unauthenticated by design, plus secrets and database files at predictable on-disk paths inside the same filesystem namespace as the handler's working directory) makes a category of bug useful. Each individual bug in the category closes. The category does not. The patch in v1.603.3 closes one bug. It does not close the category, because closing the category would require moving the secrets out of the addressable on-disk namespace, or moving the handler out of the same filesystem as the secrets, or both. Neither change is in the patch. Neither change is in PR #9416.

A second pattern is also present, weaker but worth naming: Internal Only By Convention. The SUPERADMIN_SECRET file and the Nextcloud Flow JSON config are written by the operator-side bootstrap with the expectation that nothing inside the application's HTTP surface will ever read them. That expectation is the convention. The convention held for the duration of the engineering decision to put them on disk and broke the first time a handler read a path from a URL. The Postgres filenode path is the same convention, one layer deeper: the database files on disk are an implementation detail of Postgres, not part of any API contract, and yet they are addressable and predictable and inside the same TMP_DIR neighborhood as the logs. Each of these three artifacts is "internal" by the convention that nothing reads it from outside. The handler is the rebuttal.

The prosecutorial point is not that the Windmill maintainers shipped a bad patch. The four-check patch is a reasonable, surgical, low-risk fix for the specific reported primitive. The point is that the patch operates at the wrong layer for the actual exposure. The exposure is that the application's secrets and the application's database files share a filesystem with the application's HTTP-readable working directory, and the access-control model for that filesystem is "no handler should ever read a path it got from a URL." That model was true until it was not. The patch restores the model for one endpoint. The model remains the access control for the other eleven jobs_u endpoints, for every future handler that touches the filesystem, and for every future deserializer that follows a path. The filenode is still at 17149.

The Nuclei template will not catch the next instance of this. The next instance will not be a path traversal. The next instance will be a symlink that the v1.603.3 patch's .. check does not catch, because symlinks do not contain ... The next instance will be a configuration file that lets the operator override TMP_DIR to point at /. The next instance will be a worker that writes a job result to a path computed from an untrusted job name. Each of those is a different handler, a different code path, a different commit. Each of them reaches filenode 17149. The patch in v1.603.3 does not reach 17149.

The handler was the defendant on the docket. The substrate is the defendant the docket does not name.

The patch closes one endpoint. The filenode is still at 17149.