-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 NEFARIOUSPLAN-CANONICAL-V1 {"body_md":"```rust\nasync fn get_log_file(Path((_w_id, file_p)): Path<(String, String)>) -> error::Result {\n let local_file = format!(\"{TMP_DIR}/logs/{file_p}\");\n if tokio::fs::metadata(&local_file).await.is_ok() {\n let mut file = tokio::fs::File::open(local_file).await.map_err(to_anyhow)?;\n```\n\nFour 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`.\n\nThe 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.\n\n## The pre-patch handler had no checks. The patch added four.\n\nThe 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.\n\n```rust\nif file_p.contains(\"..\") {\n return Err(error::Error::BadRequest(\"bad path\".to_string()));\n}\nlet parts: Vec<&str> = file_p.split('/').collect();\nif parts.len() != 2 {\n return Err(error::Error::BadRequest(\"bad path\".to_string()));\n}\nlet _uuid = uuid::Uuid::parse_str(parts[0])\n .map_err(|_| error::Error::BadRequest(\"bad uuid\".to_string()))?;\nif !parts[1].ends_with(\".txt\") {\n return Err(error::Error::BadRequest(\"bad ext\".to_string()));\n}\n```\n\nFour 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`.\n\nWhat 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.\n\nA 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.\n\n## The CVE title says \"rarely used.\" The PoC ships three paths to root.\n\nThe 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:\n\n```\nGET /api/w/_/jobs_u/get_log_file/..%2F..%2F..%2F..%2F..%2F..%2Fetc%2Fpasswd\n```\n\nThe 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.\n\n**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.\n\n**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.\n\n**Path three: the Postgres filenode.** Postgres stores each table as one or more files on disk, in `base//`. 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.\n\n```python\nPG_FILENODES = {\n 'global_settings': 17149,\n 'password': 16815,\n 'token': 16564,\n 'resource': 16626,\n 'usr': 16504,\n}\n```\n\nThe handler that exposed `/etc/passwd` also exposes `base//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.\n\nThe 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.\n\n## The `_u` is honest. The handler kept the promise.\n\nThe URL prefix `jobs_u` is documented as the unauthenticated subtree. It is wired in `backend/windmill-api/src/lib.rs`:\n\n```rust\n.nest(\n \"/w/:workspace_id/jobs_u\",\n jobs::workspace_unauthed_service().layer(cors.clone()),\n)\n```\n\nThe 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.\n\nThe 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.\n\n`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/`.\n\nThe four checks added by the patch enforce a subset of what the surrounding architecture promised. They check that the path looks like `/.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.\n\nThe `_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.\n\n## The four checks do not move the file.\n\nThe 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.\n\nThe 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.\n\nThis 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.\n\nA 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.\n\nThe 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.\n\nThe 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.\n\nThe handler was the defendant on the docket. The substrate is the defendant the docket does not name.","closing_line":"The patch closes one endpoint. The filenode is still at 17149.","hook_md":"```rust\nasync fn get_log_file(Path((_w_id, file_p)): Path<(String, String)>) -> error::Result {\n let local_file = format!(\"{TMP_DIR}/logs/{file_p}\");\n if tokio::fs::metadata(&local_file).await.is_ok() {\n let mut file = tokio::fs::File::open(local_file).await.map_err(to_anyhow)?;\n```\n\nFour 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`.","post_id":544,"slug":"windmill-cve-2026-29059-filenode-17149","title":"CVE-2026-29059: Windmill Patched The Handler. Postgres Filenode 17149 Is Still At 17149.","type":"initial","unreadable_sentence":"The patch closed the file read. It did not move the file."} -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQRf0htP5+SjynlxywneZjl4jgkQJgUCawjldgAKCRDeZjl4jgkQ JnvcAQC1P1XMP9IA699CPpjjjdOwrRhriX6ZWq//LWsg/0d2VgEAuAjzPJml3Lqn DNLf7TTqFfC49IqqVhk7+9Lgmt09eQA= =piLb -----END PGP SIGNATURE-----