🔒 Secure remote update mechanism using reqwest and tempfile - #310
🔒 Secure remote update mechanism using reqwest and tempfile#310undivisible wants to merge 2 commits into
Conversation
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. |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_001ba574-e24e-4c85-91d7-fb3bc31b8558) |
|
Tick the box to add this pull request to the merge queue (same as
|
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_79affc9f-6c77-48cd-bfad-095b8bab60aa) |
🎯 What: The
cmd_update_remotefunction inin-cli/src/main/update.rspreviously usedcurlpiped directly intobashto execute a remote install script. This was replaced with a native Rust implementation usingreqwestandtempfile.curl -fsSLinside a shell execution is vulnerable to network tampering, improper environment handling, or execution of arbitrary payloads (e.g. executing 404 pages if the URL was missing).🛡️ Solution: The update mechanism now uses
reqwest::blocking::getto fetch the script over HTTPS with strict TLS validation and HTTP success code checking. The response is written securely to a local temporary file usingtempfile::NamedTempFile, which is then explicitly executed bybashas a file, completely removing the inline string execution and curl dependency.PR created automatically by Jules for task 6734880655533966610 started by @undivisible
Note
Medium Risk
Changes how remote install scripts are fetched and executed (TLS and HTTP handling), though behavior is still “download and run install.sh” on Unix when local update is unavailable.
Overview
When there is no local inauguration checkout,
in updateno longer shells out tocurl -fsSL … | bash. It now downloadsinstall.shwithreqwest(blocking HTTPS), rejects non-success HTTP responses, writes the body to atempfile::NamedTempFile, and runsbashon that path only.reqwestandtempfileare added toin-cli/Cargo.toml;Cargo.lockpicks up the HTTP/TLS stack (e.g. rustls, hyper) as transitive deps.Reviewed by Cursor Bugbot for commit 6f0a9b8. Configure here.