Skip to content

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

Open
Quratulain-bilal wants to merge 1 commit into
github:mainfrom
Quratulain-bilal:fix/unbounded-workflow-catalog-read-v2
Open

fix: eliminate TOCTOU race in file unlink calls#3819
Quratulain-bilal wants to merge 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

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