← スキル一覧に戻る

securityfilesystem
by mgreenly
An AI Coding Agent
⭐ 1🍴 0📅 2026年1月24日
SKILL.md
name: security/filesystem description: Filesystem Security security skill
Filesystem Security
File operations have race conditions, symlink attacks, and path traversal risks.
ikigai Application
Path traversal:
- Reject paths containing
..before canonicalization - Use
realpath()and verify result is under allowed directory - Never concatenate user input directly into paths
TOCTOU (Time-of-Check to Time-of-Use):
// BAD: Race between check and use
if (access(path, R_OK) == 0) { fd = open(path, O_RDONLY); }
// GOOD: Open first, then check
fd = open(path, O_RDONLY);
if (fd >= 0) { /* use fd */ }
Symlink attacks:
- Use
O_NOFOLLOWwhen opening files in shared directories lstat()to check for symlinks before operations- Create temp files with
mkstemp(), nevermktemp()
Permissions:
- Config files:
0600(owner read/write only) - Directories:
0700 - Check permissions before reading sensitive files
- Set umask appropriately:
umask(077)
Review red flags: access() before open(), path concatenation, missing O_NOFOLLOW, world-readable configs.
スコア
総合スコア
60/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です