Skip to content

fix: eliminate TOCTOU race in file unlink calls - #3819

Merged
mnriem merged 1 commit into
github:mainfrom
Quratulain-bilal:fix/unbounded-workflow-catalog-read-v2
Jul 31, 2026
Merged

fix: eliminate TOCTOU race in file unlink calls#3819
mnriem merged 1 commit into
github:mainfrom
Quratulain-bilal:fix/unbounded-workflow-catalog-read-v2

Conversation

@Quratulain-bilal

Copy link
Copy Markdown
Contributor

Replace if path.exists(): path.unlink() with path.unlink(missing_ok=True) in extensions/init.py clear_cache and integrations/_helpers.py to eliminate TOCTOU race conditions.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Eliminates TOCTOU races by using atomic, missing-tolerant unlink operations.

Changes:

  • Removes existence checks before deleting integration metadata.
  • Applies the same fix to extension cache files.
Show a summary per file
File Description
src/specify_cli/integrations/_helpers.py Safely removes integration.json.
src/specify_cli/extensions/__init__.py Safely clears cache and metadata files.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Medium

@mnriem
mnriem merged commit 6bf51e7 into github:main Jul 31, 2026
14 checks passed
@mnriem

mnriem commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Thank you!

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.

3 participants