/security-agent-skills:hunting-scheduled-job-and-search-path-hijacksfrom security-agent-skills
Identifies local privilege escalation paths through scheduled jobs (cron/timer) by auditing writable job scripts, writable search-path directories, and wildcard argument injection via leading-dash filenames. Use when auditing a host or container image for automation-triggered privesc.
Ships in security-agent-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Automation escalates privilege quietly. A job runs on a timer as a privileged identity, and if anything it touches is writable by a lesser user, or if it resolves a command through a path or a wildcard that a lesser user can influence, that user's content runs as the job's identity. The bug is never the schedule; it is the trust the job places in a writable script, a writable directory on its search path, an unqualified command name, or a filename that a wildcard hands to a command as an option. You find it by listing every job, the identity it runs as, and every input it trusts, then checking which of those inputs a lesser user controls.
Audit scheduled-job and path escalation only on hosts or images you own or are authorized to test, with an unprivileged account you may escalate from. If you can't name the authorization, stop.
Enumerate every job and the identity it runs as. Inventory periodic jobs, timers, and service-triggered scripts across every location they can be defined, system-wide and per-user, and record which identity each runs as. A job running as an unprivileged service account is a smaller prize than one running as root, but map them all; the identity sets the stakes.
List every input each job trusts. For each job, follow what it executes and reads: the job script itself, any script or config or data file it sources or parses, the directories it operates over, and the commands it launches. Each of these is an input the job trusts to be benign. The audit is which of those inputs a lesser user can change.
Check writability of scripts, configs, and directories. For every trusted input, check whether a lower-privileged user can write it: a job script that is group- or world-writable, a config sourced from a writable path, a directory the job writes into or globs over that a lesser user owns. A writable trusted input is a direct hijack; the lesser user plants content that runs as the job's identity.
Check command resolution against a writable path. Where the job invokes a command by an unqualified name, determine the effective search path at run time and whether any entry is writable by, or ahead of the real binary for, a lesser user. A privileged job that runs a command by short name with a writable directory early on its path executes the planted binary as its identity.
Check wildcard and argument injection. Where the job runs a command that expands a shell wildcard over a directory a lesser user can write to, check whether a crafted filename is handed to the command as an option rather than data. A file whose name begins like a flag turns an innocent operate-on-all-files command into one carrying attacker-chosen options, several of which reach command execution or file overwrite as the job's identity. The writable directory plus the unquoted wildcard is the bug.
Confirm and record. Confirm by escalating on a test host: plant a writable-script or writable-path payload, or a flag-shaped filename in a globbed directory, and observe it run as the job's identity on the next trigger. Kill the lead if every job runs a root-owned, non-writable script, resolves commands by absolute path with a controlled environment, and globs only over directories no lesser user can write. Record with the job, the writable input or wildcard, and the execution it produced.
Confirm. A privileged periodic job archives everything in a spool directory by expanding a wildcard over it, and the spool directory is writable by an unprivileged service user. That user drops two files: one named to look like the archiver's option that runs a command, and a script for it to run. On the next trigger the archiver treats the filename as an option and executes the script as root. Confirmed wildcard argument injection to root,
high, remediation = pass--before the wildcard or an explicit file list, never glob over a writable directory, and run the job over a root-owned staging path.Kill. Every job is a root-owned, non-writable script; each invokes commands by absolute path with a fixed, minimal environment; the only directories they write or glob are root-owned and not writable by any lesser user; wildcards are guarded with an end-of-options marker. Planted scripts, path entries, and flag-shaped filenames never execute. Killed,
kill_reason= "root-owned non-writable scripts, absolute-path commands with controlled environment, no lesser-writable globbed or sourced input, wildcards option-guarded."
You need every job definition and its run-as identity across all system and per-user locations, the set of scripts, configs, directories, and commands each job trusts, the writability of each of those for every lesser identity, and the effective run-time path. An unprivileged account confirms. A view that maps each scheduled job to the files and commands it touches and flags which are writable by a lower-privileged user turns this into a coverage pass over the automation surface; the what-runs, as-whom, over-what-you-can-write question is the method by hand.
hunting-setuid-and-capability-escalation - the other local-escalation surface: binaries that
carry elevated identity directly.hunting-dynamic-linker-hijacks - when the writable input a job trusts is a library the loader
finds, not a script or command.detecting-race-conditions - a job that checks then acts on a path a lesser user can swap is a
TOCTOU on top of the trust gap.finding-fail-open-flaws - a job that proceeds when an input is missing or malformed is the
fail-open shape in automation.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub unboundcompute/security-agent-skills --plugin security-agent-skills194 skills in this plugin
/adjudicating-dependency-cve-reachabilityDecide whether a CVE in a dependency actually exposes your application before you scramble to patch: is the vulnerable function on a real call path from your code, do the trigger preconditions hold, and can an attacker control the input that reaches it. Use when an advisory, SCA scan, or dependency bot flags a CVE and you must separate a genuine exposure from unreachable noise, or justify why you are or are not affected. Covers pinning the vulnerable symbol, call-path reachability, precondition checks, and taint from your entry points./adjudicating-taint-pathsDecide whether a whitebox lead is a real bug by tracing taint from an untrusted source to a dangerous sink and confirming every hop against live source. Use after a scanner, a candidate list, or your own reading surfaces a "this looks dangerous" sink (SQL exec, system/exec, file open, deserialize, template render, redirect target, memcpy) and you must decide whether attacker- controlled input actually reaches it - or kill the lead with evidence. Covers forward and reverse taint, witness paths, sanitizer analysis, and the evidence rules that separate a finding from a false positive.Other plugins' skills for the same job