Skip to content

fix: eliminate TOCTOU race in yamlio.load_yaml() - #3909

Open
Quratulain-bilal wants to merge 1 commit into
github:mainfrom
Quratulain-bilal:fix/yamlio-load-toctou
Open

fix: eliminate TOCTOU race in yamlio.load_yaml()#3909
Quratulain-bilal wants to merge 1 commit into
github:mainfrom
Quratulain-bilal:fix/yamlio-load-toctou

Conversation

@Quratulain-bilal

Copy link
Copy Markdown
Contributor

Problem

yamlio.load_yaml() checks exists() then calls read_text(). The file can be deleted between the two calls, causing a raw FileNotFoundError instead of the clear BundlerError.

Fix

Remove the exists() pre-check and catch FileNotFoundError from read_text().

Testing

  • Verified BundlerError is raised when file is missing

Remove exists() pre-check and catch FileNotFoundError from read_text()
to provide a clear BundlerError even under race conditions.
@Quratulain-bilal
Quratulain-bilal requested a review from mnriem as a code owner July 31, 2026 12:57
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.

1 participant