Skip to content

fix: Avoid following symlinks during recursive cleanups#1751

Open
jpnurmi wants to merge 2 commits into
masterfrom
jpnurmi/fix/symlink
Open

fix: Avoid following symlinks during recursive cleanups#1751
jpnurmi wants to merge 2 commits into
masterfrom
jpnurmi/fix/symlink

Conversation

@jpnurmi
Copy link
Copy Markdown
Collaborator

@jpnurmi jpnurmi commented May 25, 2026

A symlinked .run entry in a shared or pre-existing database directory could pass the stat-based directory checks used by old-run processing. That allowed cleanup to traverse attacker-controlled symlink targets and delete files outside the SDK cache.

Detect symlinks explicitly and avoid recursing through them during cleanup, so old run processing removes only real cache directories and never follows a planted .run symlink.

jpnurmi and others added 2 commits May 25, 2026 17:23
A symlinked .run entry in a shared or pre-existing database directory could
pass the stat-based directory checks used by old-run processing. That allowed
cleanup to traverse attacker-controlled symlink targets and delete files
outside the SDK cache.

Detect symlinks explicitly and avoid recursing through them during cleanup, so
old run processing removes only real cache directories and never follows a
planted .run symlink.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
@jpnurmi jpnurmi changed the title fix(path): Avoid following symlinks during recursive cleanups fix: Avoid following symlinks during recursive cleanups May 25, 2026
@jpnurmi jpnurmi requested review from JoshuaMoelans and mujacica May 27, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants