Skip to content

fix: Avoid following symlinks during recursive cleanups#1751

Merged
jpnurmi merged 3 commits into
masterfrom
jpnurmi/fix/symlink
May 28, 2026
Merged

fix: Avoid following symlinks during recursive cleanups#1751
jpnurmi merged 3 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
@jpnurmi jpnurmi merged commit b22dd8b into master May 28, 2026
99 of 100 checks passed
@jpnurmi jpnurmi deleted the jpnurmi/fix/symlink branch May 28, 2026 08:56
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