/security-agent-skills:hunting-dynamic-linker-hijacksfrom security-agent-skills
Hunts local privilege escalation and code execution via dynamic loader hijacks: preload variables across privilege boundaries, writable library search path directories, embedded run-paths pointing at attacker-influenced locations, and unqualified library loads. Use when auditing privileged binaries, services, or container images.
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.
A trusted program can be perfectly written and still run your code, because it does not choose most of the code it executes: the dynamic loader does, resolving library dependencies at startup and on demand from a search path and a set of environment variables. If any input to that resolution crosses a privilege boundary under attacker influence - a preload variable the privileged process still honors, a writable directory on its search path, a run-path relative to a location you can write - the loader maps your library into the privileged process and runs your initializer as its identity. You find it by asking, for each privileged binary, where the loader looks for code and which of those places an attacker can control.
Audit loader-based escalation only on hosts, images, or binaries you own or are authorized to test, with an unprivileged account you may escalate from. If you can't name the authorization, stop.
Identify the privileged binaries and how they launch. Inventory the programs that run as a more privileged identity - services, setuid binaries, jobs - and determine the environment each starts with: what a service manager passes, what a delegation rule preserves or clears, what a parent process hands down. The launch environment decides whether the loader's attacker-facing controls are live across the boundary.
Check whether preload variables survive the boundary. The loader ignores preload and library-path variables for a setuid binary launched directly, but a service manager, a delegation rule that preserves the environment, or a wrapper script can carry them across. Determine, per launch path, whether an attacker-set preload or library-path variable reaches the privileged process. Where it does, any preloaded library runs as the privileged identity.
Map the runtime library search path and its writability. Reconstruct the ordered search path the loader uses for each binary: the configured system library directories, any cache, and the binary's embedded run-path. For each entry, check whether a lower-privileged user can write it, or write a library that resolves ahead of the intended one. A writable directory anywhere the loader searches is a planted-library escalation.
Inspect embedded run-path and origin-relative entries. Read the run-path and search-path entries baked into the binary. Flag any that are writable, that are relative rather than absolute, or that are expressed relative to the binary's own location where that location - or a component of it - is writable by a lesser user. An origin-relative run-path into a directory a lesser user controls is a standing hijack.
Find unqualified and attacker-named dynamic loads. Where the program loads a library by an unqualified or partial name at runtime, or builds a library name from input, check whether the resolved path can be steered to attacker content through the search path or the name itself. A dynamic load of a short name resolves through the same writable-path exposure as a startup dependency.
Confirm and record. Confirm by escalating on a test host: set the surviving preload variable, plant a library in a writable search-path or origin-relative directory, or satisfy an unqualified load with attacker content, and observe your initializer run as the privileged identity. Kill the lead if preload and library-path variables are stripped across every boundary, every search-path and run-path entry is root-owned and non-writable and absolute, and no dynamic load resolves through an attacker-controllable path. Record with the binary, the loader input, and the escalation.
Confirm. A privileged service is started by a manager unit that preserves the invoking environment, and the service binary loads a plugin library by an unqualified name. An unprivileged user sets the loader's preload variable to a library in a directory they own; the manager carries the variable across, and the loader maps the attacker library into the service, running its initializer as root. Confirmed preload-across-boundary escalation,
high, remediation = clear preload and library-path variables in the unit and delegation rules, and load the plugin by absolute path from a root-owned directory.Kill. Every privileged launch clears preload and library-path variables; all configured library directories and every binary's run-path are absolute, root-owned, and non-writable; no run-path is origin-relative into a writable location; the one runtime dynamic load uses an absolute path. Planted libraries and preload variables never load. Killed,
kill_reason= "preload and library-path stripped across all boundaries, all search-path and run-path entries absolute, root-owned, non-writable, dynamic load by absolute path."
You need the set of privileged binaries and their real launch environments, the reconstructed runtime search path and embedded run-path for each, the writability of every search-path component for lesser identities, and an unprivileged account to confirm. A view that resolves, per binary, where the loader looks for code - configured directories, cache, run-path, origin expansion - and flags which entries a lower-privileged user can influence turns this into a coverage pass over the loader surface; the where-does-it-look-and-who-controls-it question is the method by hand.
hunting-setuid-and-capability-escalation - the binaries that carry elevated identity, whose library
loads this skill examines in depth.hunting-scheduled-job-and-search-path-hijacks - the command-path analog of this library-path bug,
for scripts and scheduled jobs.auditing-declared-vs-used-permissions - the environment a service is granted versus what it needs;
a preserved environment is an over-grant here.detecting-memory-safety-bugs - a loaded library is native code in the process; the two escalation
surfaces compound.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