Repository navigation
fix(runtimes): harden staging ownership, download deadlines, and async subprocess waits - #1199
Merged
Merged
Conversation
Contributor
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
PyRo1121
force-pushed
the
fix/runtime-staging-deadlines-async-subproc
branch
5 times, most recently
from
December 1, 2026 22:59
3b1ba47 to
8d1d749
Compare
…link-safe extraction
PyRo1121
force-pushed
the
fix/runtime-staging-deadlines-async-subproc
branch
from
December 1, 2026 23:57
8d1d749 to
4391b1b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses the four source-confirmed Rust runtime audit findings on top of
main(629b5be8):spawn_blocking(src/runtimes/common.rs+ all 13 staged runtime installers):extract_tar_gz_staged,extract_tar_gz_staged_with_budget,extract_tar_xz_staged, andextract_zip_stagedwhich transfertempfile::TempDirownership intotokio::task::spawn_blockingand returnResult<tempfile::TempDir>.src/runtimes/common.rs):ExtractTaskGuardacross gzip, xz, and zip extraction so errors reportOutcome::Failedon drop and never reportOutcome::Done.extract_task+ unconditionaltask.finish(Outcome::Done)wrappers inextract_tar_gz_with_budgetandextract_tar_xz.src/core/http.rs,src/runtimes/common.rs):fetch_public_download_with_optionscomputes a singleInstantdeadline before the redirect loop and clamps DNS lookup, connect/read, and per-hop timeouts to the remaining budget instead of resetting per hop.stream_runtime_download_to_temp_with_limitsenforces an overall wall-clock deadline (DOWNLOAD_OVERALL_TIMEOUT = 20m) across attempts/chunks and fails cleanly on final-attempt low-speed stalls instead of hanging indefinitely.src/runtimes/tool_artifacts.rs,src/runtimes/erlang.rs,src/runtimes/php.rs):tool_artifacts::run_with_timeout_asyncwrappingtokio::task::spawn_blocking.erlang.rs(run_install_script,smoke_erl) andphp.rs(smoke_php_async) to await it instead of blocking Tokio worker threads.Verification
--no-default-features) with 0 compiler warnings and 370 unit tests passed, 0 failed acrosscore::http,runtimes::common,runtimes::tool_artifacts,runtimes::erlang,runtimes::php,runtimes::github_tool, and all 10 other updated runtime modules.core::http::metadata_limit_tests::fetch_public_download_with_timeout_enforces_overall_deadline_across_redirectsruntimes::common::entry_budget_tests::extract_tar_gz_staged_transfers_ownership_and_cleans_up_on_cancelruntimes::common::entry_budget_tests::stream_runtime_download_enforces_overall_deadline_on_trickleruntimes::tool_artifacts::tests::run_with_timeout_async_does_not_block_tokio_workerOpen in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.