Conversation
- Use `tempfile::NamedTempFile` for secure, unpredictable temporary filenames. - Preserve original file permissions when performing in-place updates. - Ensure atomic file replacement via `persist()`. - Move `tempfile` to main dependencies. - Update tests to reflect new output path logic. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
- Use `tempfile::NamedTempFile` for secure, unpredictable temporary filenames. - Preserve original file permissions when performing in-place updates. - Ensure atomic file replacement via `persist()`. - Pin `tempfile` to 3.12.0 to maintain MSRV compatibility (Rust 1.82). - Fix Clippy warning by using the `?` operator. - Update tests to reflect new output path logic. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
- Use `tempfile::NamedTempFile` for secure, unpredictable temporary filenames. - Preserve original file extension for temporary files to support external tools like `gdal_translate`. - Preserve original file permissions when performing in-place updates. - Ensure atomic file replacement via `persist()`. - Pin `tempfile` to 3.12.0 to maintain MSRV compatibility (Rust 1.82). - Fix Clippy warning by using the `?` operator. - Update tests to reflect new output path logic. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
- Use `tempfile::NamedTempFile` for secure, unpredictable temporary filenames. - Preserve original file extension for temporary files to support external tools like `gdal_translate`. - Preserve original file permissions when performing in-place updates. - Ensure atomic file replacement via `persist()`. - Pin `tempfile` to 3.12.0 to maintain MSRV compatibility (Rust 1.82). - Fix Clippy warning by using the `?` operator. - Update tests to reflect new output path logic. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
π¨ Severity: HIGH
π‘ Vulnerability: Predictable temporary filenames and loss of file permissions during in-place updates.
π― Impact: The application was vulnerable to symlink attacks where an attacker could pre-create a symlink with the predictable name
.unc.<filename>to trick the tool into overwriting a sensitive file. Additionally, restricted permissions (e.g.,600) were lost during processing, potentially making sensitive data world-readable.π§ Fix: Integrated the
tempfilecrate for secure temporary file creation with random suffixes. The tool now captures the original file's permissions and applies them to the new file before atomically replacing the original usingpersist().β Verification: Verified using reproduction scripts that permissions are now preserved and symlink attacks are prevented. Standard unit tests pass (ignoring pre-existing failures due to missing system dependencies).
PR created automatically by Jules for task 11030320871833359191 started by @kassoulet