Unsafe Temporary File Creation
Detects creation of temporary files with predictable names or in world-writable locations, enabling symlink attacks and race conditions.
от zakirkun★ 40 звёзд на GitHub
Установить Unsafe Temporary File Creation в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Unsafe Temporary File Creation
Overview
Creating temporary files insecurely can lead to:
- Symlink attacks: Attacker pre-creates a symlink at the predicted temp path, redirecting writes to sensitive files
- TOCTOU race conditions: Time-of-check vs time-of-use between name generation and file open
- Information disclosure: Predictable temp file names allow attackers to read sensitive data
Detection Strategy
- Using
mktemp(insecure, returns name only) instead ofmkstemp(securely opens file) - Building temp file paths from predictable strings:
/tmp/app_+ PID - Using
/tmpdirectly with hardcoded suffixes
Remediation
Use language-provided secure temp file APIs that atomically create and open the file.
Vulnerable (Python):
import tempfile, os
tmp_path = '/tmp/myapp_' + str(os.getpid())
with open(tmp_path, 'w') as f: # Race condition!
f.write(data)
Safe (Python):
import tempfile
with tempfile.NamedTemporaryFile(mode='w', delete=True) as f:
f.write(data)
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- patterns.yaml
FAQ
Что делает скилл Unsafe Temporary File Creation?
Detects creation of temporary files with predictable names or in world-writable locations, enabling symlink attacks and race conditions.
Как установить скилл Unsafe Temporary File Creation?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Unsafe Temporary File Creation запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…