Skip to content

Conversation

@cgwalters
Copy link
Collaborator

This one shouldn't have gotten through code review, I noticed it when debugging something else.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly addresses a security vulnerability by replacing a predictably named temporary file in /tmp with a securely generated one using tempfile::NamedTempFile. This prevents potential TOCTOU race condition attacks. The change is well-implemented and improves the security of the application.

While reviewing, I noticed another instance of this vulnerability in the same file that was not addressed. In the ensure_default_pool function (line 637 of crates/kit/src/libvirt/run.rs), the file /tmp/default-pool.xml is created with a hardcoded, predictable path. This presents the same security risk that this PR aims to fix. It is recommended to also update this to use tempfile::NamedTempFile to fully resolve the security issue of using predictable file names in /tmp.

This one shouldn't have gotten through code review, I noticed
it when debugging something else.

Signed-off-by: Colin Walters <walters@verbum.org>
@cgwalters cgwalters force-pushed the fix-predictable-tmp branch from ba43ff0 to a30e23b Compare December 3, 2025 13:59
@cgwalters cgwalters enabled auto-merge (rebase) December 3, 2025 14:10
@cgwalters cgwalters merged commit 92cc086 into bootc-dev:main Dec 3, 2025
11 of 13 checks passed
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