Toctou file

From zakirkun/ice-tea · View interactive version

Toctou file is an AI agent skill from the GitHub repository zakirkun/ice-tea. Detects file operations that check file properties before using them, creating a race window exploitable via symlink attacks.

How to use this skill

Skill file

File TOCTOU Race Condition

Overview

TOCTOU (Time-of-Check/Time-of-Use) vulnerabilities occur when there is a window between checking a file's state and using it. An attacker can replace the file with a symlink between the check and the use, potentially reading/writing arbitrary files.

Classic pattern: if access(path, R_OK) == 0: open(path) — between access() and open(), attacker creates symlink.

Remediation

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.