--- id: "bug-1868" status: "fixed" status_updated: "2026-09-26" status_note: "7864a3da: xcecd_create_job_output() unlinks then creates with O_EXCL|O_NOFOLLOW|O_CLOEXEC." component: "worker" severity: "security" timestamp: "2026-09-26T07:40:17Z" last_seen: "2026-09-26T07:40:17Z" occurrences: 1 files: ["src/worker/src/uv_proc.c"] tags: ["security", "worker", "symlink", "tmp", "uv_proc"] related: ["bug-1508"] fix_commits: ["7864a3da"] legacy: true gitea_issue: 288 gitea_synced_status: "fixed" gitea_synced_hash: "a6d6a8485b1c" --- # bug-1868: uv_proc_exec (worker/src/uv_proc.c) creates each task's output file /tmp/job__task.out… ## Description uv_proc_exec (worker/src/uv_proc.c) creates each task's output file /tmp/job__task.out as root with O_WRONLY|O_CREAT|O_TRUNC and no O_NOFOLLOW/O_EXCL: a local user who pre-plants a symlink at a predictable future job's output name makes the root worker truncate and write job output into the symlink target ## Environment _Not recorded (migrated from buglog.json)._ ## Reproduction _Not recorded (migrated from buglog.json)._ ## Root cause Predictable name in world-writable /tmp opened by root following symlinks. Only mitigated by the host's fs.protected_symlinks / fs.protected_regular sysctls, not by the code. Sibling of bug-1508 (read side, fixed in 7723a4f4). ## Fix _Not recorded (migrated from buglog.json)._ ## Verification _Not recorded (migrated from buglog.json)._ ## References - Related: bug-1508 - Gitea: #288