Skip to content

Update url to 2.5.9 (RUSTSEC-2026-0592) #3538

Closed

Description

@fengmk2

The Security Analysis job fails when cargo-deny checks Cargo.lock. main locks url v2.5.8, which RUSTSEC-2026-0592 affects. In url 2.5.8 and earlier, Url::origin() handles a blob: URL by calling itself on the inner URL with no depth limit, so a URL with many nested blob: prefixes overflows the stack and aborts the process. url 2.5.9 fixes it. Failing CI job · RustSec advisory · Base lockfile

url comes in through reqwest, tower-http, vt_remote_cache, and the Rolldown crates, and vp_global_cli and vp_cli_snapshots depend on it directly. vp_pm_cli calls Url::origin() on the target of a package registry redirect, so a registry or proxy that returns a crafted Location header may crash vp. It also calls Url::origin() on the configured registry URL. Redirect check · Registry check

Run cargo update -p url, which moves url to 2.5.9 and form_urlencoded to 1.2.3. Raise the workspace requirement to 2.5.9, so that the lockfile cannot resolve to an affected version again. Workspace requirement

Verify that cargo deny check advisories no longer reports RUSTSEC-2026-0592. The same job also reports RUSTSEC-2026-0387 for crypto-bigint, so it can still fail after this change.

Activity

  1. voidzero-bot commented on Nov 22, 2026

    @voidzero-bot
    Contributor
    • Reproduced: Yes
    • Exploration: Yes
    • Unit Test: No — the fix is a dependency upgrade (Cargo.lock + workspace requirement in Cargo.toml), which the automated triage stage leaves to maintainers; the defect itself lives upstream in the url crate, so a local regression test wasn't applicable.
    • Priority P4: important. This fails the enforced Security Analysis cargo-deny gate on main, and maintainer precedent for the identical advisory report (Replace the unmaintained chrono dependency in vp_global_cli (RUSTSEC-2026-0543) #3495, RUSTSEC-2026-0543) was also labeled P4. The practical crash risk for users is narrow (a hostile registry/proxy Location header or a constrained-stack thread), but shipping a known process-abort vulnerability in every vp binary and keeping CI red on main warrants prompt remediation.

    main locks url v2.5.8 (the last version affected by RUSTSEC-2026-0592) at Cargo.lock:8264-8267, with the workspace floor at only url = "2.5.8" (Cargo.toml:304). In url 2.5.8, url_origin() recurses on any successfully parsed inner URL of a blob: URL with no depth limit; I confirmed the advisory directly — a URL with nested blob: prefixes aborts the process with a stack overflow (exit 134) under url = "=2.5.8", while the identical program completes under url = "=2.5.9". vp_pm_cli feeds a registry-supplied Location header into Url::origin() in its redirect loop (crates/vp_pm_cli/src/request.rs:~125), so a crafted redirect from a hostile registry or proxy is a crash vector, alongside is_default_registry in crates/vp_pm_cli/src/config.rs:222-227.

    I identified the fix but did not implement it, since it is a dependency upgrade that edits the tracked lockfile and belongs to a maintainer-reviewed PR (matching the #3495/#3331 precedents). Concretely, cargo update -p url (verified via --dry-run: moves exactly url 2.5.8 → 2.5.9 and form_urlencoded 1.2.2 → 1.2.3, 149 deps unchanged) plus raising Cargo.toml:304 to url = "2.5.9" (and form_urlencoded = "1.2.3" at line 195) so the lockfile can never re-resolve to an affected version. url 2.5.9 only changes blob:-origin semantics (nested blob: becomes opaque), which cannot affect the two origin() comparison sites since registry URLs are always http(s). Note the Security Analysis job may still fail afterwards due to the unrelated RUSTSEC-2026-0387 advisory for crypto-bigint.

    Full Triage Report

    Triage Report — Issue #3538: Update url to 2.5.9 (RUSTSEC-2026-0592)

    Result: Reproduced

    Issue Summary

    • Expected: The Security Analysis cargo-deny job passes; Cargo.lock does not resolve url to a version affected by RUSTSEC-2026-0592 (unbounded recursion in Url::origin() for nested blob: URLs → stack overflow / process abort), and the workspace url requirement is at least 2.5.9.
    • Actual: Current checkout (286f32006, same commit the issue links to) locks url v2.5.8 — the last affected version — and Cargo.toml (line 304) requires only url = "2.5.8", so the lockfile can resolve back to the affected version. cargo deny check advisories therefore reports RUSTSEC-2026-0592 and the job fails.

    Environment

    • OS: Ubuntu (GitHub Actions runner)
    • vp v1.7.0 (local vite-plus v1.7.0), Node v24.22.3, pnpm v12.11.2
    • cargo 1.99.0-nightly (7c83d4cc0 2026-07-29), rustc 1.99.0-nightly
    • cargo-deny: not installed on this runner (checked: cargo deny → no such command)

    Evidence on the checkout

    1. Cargo.lock lines 8264–8267 pin the affected version, exactly matching the issue's link:
      name = "url"
      version = "2.5.8"
      source = "registry+https://github.com/rust-lang/crates.io-index"
      checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed"
      
    2. Cargo.toml workspace requirement is url = "2.5.8" (line 304), and form_urlencoded = "1.2.2" (line 195), matching the issue's plan to move both.
    3. vp_pm_cli calls Url::origin() on attacker-influenceable input:
      • crates/vp_pm_cli/src/request.rs (~line 125): next_url.origin() / response.url().origin() on the redirect target derived from a registry's Location header.
      • crates/vp_pm_cli/src/config.rs (~line 226): url.origin() == default.origin() on the configured registry URL.

    Reproduction

    Path: /tmp/vite-plus-triage/gh-3538/repro (affected case) and /tmp/vite-plus-triage/gh-3538/repro-control (control case).

    Minimal binary pinned to the locked version:

    [dependencies]
    url = "=2.5.8"   # control: url = "=2.5.9"
    let raw = format!("{}https://example.com/", "blob:".repeat(n));
    let u = Url::parse(&raw).unwrap();
    // call u.origin() on a thread with a constrained stack, as worker threads have
    std::thread::Builder::new().stack_size(512 * 1024).spawn(move || { u.origin(); })

    Commands and results:

    Command Result
    cargo run --release -- 10000 512 with url = "=2.5.8" exit 134 — thread '<unknown>' (6250) has overflowed its stack / fatal runtime error: stack overflow, aborting / Aborted (core dumped)
    cargo run --release -- 10000 512 with url = "=2.5.9" (control) exit 0 — returns Opaque(OpaqueOrigin(0)) in ~0.7 ms, no crash

    Additional observations from depth sweeps (all with 2.5.8):

    • origin() on 1 000–40 000 nested blob: prefixes on an 8 MB main-thread stack does not abort (each recursion frame is small), but parse time is quadratic: 10 000 prefixes parse in <1 ms, 60 000 prefixes exceeded a 90 s timeout.
    • Debug builds are too slow in Url::parse to reach the origin() recursion at depths that overflow an 8 MB stack within the timeouts used.

    Control result

    The identical program against url = "=2.5.9" completes normally, confirming the abort is specific to url 2.5.8 and matches RUSTSEC-2026-0592's description.

    Observations for diagnosis (no fix applied)

    • The lockfile and workspace requirement are the direct cause of the CI failure; the advisory is real and reproducible in the locked version.
    • vp_pm_cli's redirect handling (request.rs) feeds a Location-header-derived URL into Url::origin(); a hostile registry/proxy can therefore crash vp through the same unbounded recursion, though only in contexts with a constrained stack — the 8 MB main-thread stack tolerates ~40 000 nesting levels. Depth is attacker-chosen via the header, so this is not bounded in practice.
    • The Security Analysis job also reports RUSTSEC-2026-0387 for crypto-bigint, so that job can still fail after url is updated, as the issue notes.
    • cargo-deny is not available on this runner, so cargo deny check advisories could not be run directly; reproduction relies on the lockfile pin plus a direct reproduction of the advisory's stack-overflow condition.

    Diagnosis

    Root Cause

    Two layers, one upstream and one in this repository:

    Upstream defect (url 2.5.8) — proven by source inspection

    ~/.cargo/registry/src/.../url-2.5.8/src/origin.rs:

    pub fn url_origin(url: &Url) -> Origin {
        let scheme = url.scheme();
        match scheme {
            "blob" => {
                let result = Url::parse(url.path());
                match result {
                    Ok(ref url) => url_origin(url),   // ← unbounded recursion
                    Err(_) => Origin::new_opaque(),
                }
            }
            ...

    For a blob: URL the function parses the path as an inner URL and recurses with no depth limit. A Location value like blob: repeated N times followed by https://example.com/ parses successfully at every level (each nested prefix is a valid inner URL), so origin() recursion depth is attacker-chosen and unbounded; each frame eventually exhausts the stack and the process aborts (observed in the reproduction: exit 134, "fatal runtime error: stack overflow, aborting").

    url-2.5.9/src/origin.rs fixes it by only recursing when the inner scheme is http, https, or file (per the WHATWG URL Standard), so a nested blob: inner URL falls through to Origin::new_opaque() and recursion stops at one level:

    Ok(ref url) if matches!(url.scheme(), "http" | "https" | "file") => url_origin(url),
    _ => Origin::new_opaque(),

    The 2.5.9 control case returned Opaque(OpaqueOrigin(0)) for nested blob: URLs, confirming the behavioral fix.

    Repository-level cause — proven by lockfile and manifest inspection

    • Cargo.lock:8264-8267 pins url v2.5.8 (the last affected release); the checksum matches the issue's link verbatim.
    • Cargo.toml:304 ([workspace.dependencies]) declares url = "2.5.8". Cargo semver would allow 2.5.9, but the lockfile pins 2.5.8 and the requirement does not prevent a future cargo update from re-resolving into another affected 2.5.x — raising the floor to 2.5.9 guarantees resolution ≥ the fixed version.
    • Cargo.toml:195 declares form_urlencoded = "1.2.2"; lockfile pins 1.2.2 (Cargo.lock:2092-2094). url 2.5.9 requires form_urlencoded 1.2.3, so the update also moves that package.
    • Direct dependents of url in the lockfile (8): reqwest, rolldown, rolldown_binding, rolldown_plugin_vite_resolve, tower-http, vp_cli_snapshots, vp_global_cli, vt_remote_cache — matching the issue. All resolve through the single workspace url entry, so one bump covers them.

    In-repository exposure (crash surface for vp)

    vp_pm_cli uses reqwest::Url (a re-export of the same url crate) and calls Origin::origin():

    • crates/vp_pm_cli/src/request.rs (~line 125), in HttpClient's redirect loop: next_url is built by joining the registry/proxy-supplied Location header onto the request URL, then next_url.origin() != response.url().origin() decides credential retention. MAX_NPM_REDIRECTS = 10 bounds the number of hops but not the depth of a single URL — one crafted Location value with many blob: prefixes reaches the unbounded recursion in one hop, so a hostile/misconfigured registry or proxy can crash vp (denial of service).
    • crates/vp_pm_cli/src/config.rs:222-227 (is_default_registry): url.origin() == default.origin() on the user-configured registry URL — same recursion if a config value is crafted, though that input is local configuration rather than remote data.

    The remaining dependents (reqwest/tower-http/rolldown/vt_remote_cache) do not necessarily call origin(), but the lockfile still ships the affected code into every vp binary, which is what cargo-deny flags.

    Suggested Fix Approach

    1. cargo update -p url — verified with --dry-run on this checkout: Updating url v2.5.8 -> v2.5.9 and Updating form_urlencoded v1.2.2 -> v1.2.3 (2 packages, all other 149 deps unchanged). This matches the issue's plan.
    2. Raise the workspace requirement Cargo.toml:304 from url = "2.5.8" to url = "2.5.9" so the resolver can never pick an affected version again. Update form_urlencoded at Cargo.toml:195 to 1.2.3 to keep the declared floor consistent with the new lockfile.
    3. Verify with cargo deny check advisories (config comes from oxc-project/security-action in .github/workflows/security.yml; there is no local deny.toml, and cargo-deny is not installed on this runner). The job is expected to still report RUSTSEC-2026-0387 for crypto-bigint, unrelated to this change.
    4. Validate with just check / just test / just lint since the bump touches every Rust binary through reqwest.

    Edge Cases and Behavioral Notes

    • url 2.5.9 changes Origin semantics for blob: URLs: the origin of the inner URL is taken only for http/https/file inner schemes; all other (including nested blob:) are opaque. In vp_pm_cli, both origin() call sites compare registry URLs, which are always http(s), so redirect-credential logic and is_default_registry behave identically after the bump. No other in-repo code calls Origin/origin() on user data.
    • form_urlencoded 1.2.2 → 1.2.3 is a patch bump pulled in by url 2.5.9; no API change is expected for consumers (it is an internal dependency of url).
    • The vulnerability requires deep nesting (~40 000 prefixes survive an 8 MB main-thread stack in release builds), so the practical crash vector for vp is constrained-stack threads or very deep headers, not ordinary registry traffic.

    Regression Evidence

    • Reproduced: exit 134 stack-overflow abort with url =2.5.8, nested-blob: recursion (see reproduction section above).
    • Control: identical program with url =2.5.9 completes normally.
    • cargo update -p url --dry-run shows the intended resolution is available and touches only the two expected packages.
    • Cargo.lock on this checkout is byte-identical before and after the dry run (no instrumentation or modification left behind; working tree clean).

    Confidence: high

    The failing logic (unbounded recursion in url 2.5.8's url_origin) is proven by upstream source inspection, its effect (process abort) is observed directly, and the repository cause (lockfile pin + workspace floor below 2.5.9) is confirmed in the exact files and lines the issue cites.


    Verification (Intent Research)

    Claim

    • Observed: main (commit 286f32006, current checkout) locks url v2.5.8 (Cargo.lock:8264-8267) with a workspace requirement of only url = "2.5.8" (Cargo.toml:304), causing the Security Analysis workflow's cargo-deny advisory check to report RUSTSEC-2026-0592 and fail. The locked version demonstrably contains the unbounded-recursion defect (reproduced above).
    • Reporter expects: url updated to 2.5.9 and the workspace requirement raised to 2.5.9 so the lockfile can never resolve to an affected version again, with cargo deny check advisories clearing RUSTSEC-2026-0592 (while the unrelated RUSTSEC-2026-0387 for crypto-bigint may still fail the job).

    Intent Evidence

    1. The repo deliberately runs a Security Analysis gate that fails on advisories. .github/workflows/security.yml ("Security Analysis", on PRs and main pushes) runs oxc-project/security-action@a8d382d3..., whose cargo-deny advisory check is the job the issue cites. There is no local deny.toml and no ignore/exception anywhere in the tree for RUSTSEC-2026-0592 (repo-wide RUSTSEC grep finds only an upstream rolldown changelog note and an RFC reference), so a lockfile free of advisory-affected crates is explicit, enforced intent.
    2. Maintainer precedent treats this exact class of report as a bug to fix in-repo. Issue Replace the unmaintained chrono dependency in vp_global_cli (RUSTSEC-2026-0543) #3495 ("Replace the unmaintained chrono dependency in vp_global_cli (RUSTSEC-2026-0543)") was filed in the same format and was labeled - P4: important, triage: fix verified, then fixed by commit 3e9de277b "fix(global): replace chrono with jiff for installation timestamps (fix(global): replace chrono with jiff for installation timestamps #3496)". Similarly commit fe81686b "fix(deps): update zstd to 0.13.4 for RustSec advisories (fix(deps): update zstd to 0.13.4 for RustSec advisories #3331)". Security-advisory remediation in this repository is an established, actionable bug class, not accepted risk.
    3. The url 2.5.8 pin is not an intentional choice. git blame shows Cargo.toml:304 (url = "2.5.8") and line 195 (form_urlencoded = "1.2.2") both come from automated Renovate commit a0b138a62 (2026-10-26, "fix(deps): synchronize upstream requirements and remove unused dependencies (fix(deps): synchronize upstream requirements and remove unused dependencies #3234)") — a mechanical upstream sync made before the advisory's fixed release, with no deliberate selection of the affected version and no related discussion in the issue tracker (gh search for "RUSTSEC" returns only Update url to 2.5.9 (RUSTSEC-2026-0592) #3538 and the closed Replace the unmaintained chrono dependency in vp_global_cli (RUSTSEC-2026-0543) #3495).
    4. Vite+ owns the fix. The vulnerable call sites are Vite+ code (crates/vp_pm_cli/src/request.rs redirect origin() comparison, crates/vp_pm_cli/src/config.rs is_default_registry), and the dependency requirement/lockfile live in this repository's Cargo.toml/Cargo.lock. The underlying defect is upstream in the url crate, but no upstream clone here (rolldown/, vite/, oxc-node/) owns the lockfile entry — the bump is made and validated in this repo, matching the closed Replace the unmaintained chrono dependency in vp_global_cli (RUSTSEC-2026-0543) #3495/fix(deps): update zstd to 0.13.4 for RustSec advisories #3331 precedents.

    Verdict: bug

    The lockfile pins a crate version with a proven, reproduced process-abort vulnerability, and the workspace requirement permits re-resolving to affected versions. This contradicts the repository's explicit, enforced intent (the Security Analysis workflow exists precisely to reject advisory-affected lockfiles, with no ignore entry for this advisory) and maintainer precedent for identical reports. It is not intended behavior and not an upstream-forwarded quirk: Vite+ controls the requirement floor and the lockfile resolution.

    Confidence: high

    Direct evidence: enforced CI gate with no advisory exception, blame showing the pin originated from an automated sync rather than a decision, and a maintainer-fixed precedent issue with identical structure labeled P4: important, triage: fix verified.


    Fix Stage

    Decision: Not implemented (fixed: false) — dependency upgrade, left to maintainers

    The fix stage excludes changes that "need a product decision, dependency upgrade, release, or broad refactor", and this issue's entire fix is a dependency upgrade:

    • cargo update -p url to move url 2.5.8 → 2.5.9 and form_urlencoded 1.2.2 → 1.2.3 in Cargo.lock (verified available via cargo update -p url --dry-run: exactly 2 packages change, 149 unchanged), and
    • raising the workspace requirement at Cargo.toml:304 from url = "2.5.8" to url = "2.5.9" (and aligning form_urlencoded = "1.2.3" at line 195).

    A dependency bump necessarily edits the tracked lockfile, which the fix stage also prohibits. Repository automation owns dependency refreshes here (Renovate plus the renovate-lockfiles workflow), and maintainer precedent (#3495/#3496, #3331) shows these security bumps are merged as small human-reviewed PRs.

    Assignee check: $GITHUB_EVENT_PATH read successfully; issue has no assignees, so the exclusion for assignee-owned fixes does not apply. The reproducer, diagnosis (high confidence), and verdict (bug) all support a fix; only the dependency-upgrade/lockfile rules of this stage prevent implementing it.

    Suggested implementation for the maintainer PR

    cargo update -p url   # url 2.5.8 -> 2.5.9, form_urlencoded 1.2.2 -> 1.2.3
    # then edit Cargo.toml: url = "2.5.9" (line 304), form_urlencoded = "1.2.3" (line 195)

    Validate with cargo deny check advisories (RUSTSEC-2026-0592 should clear; RUSTSEC-2026-0387 for crypto-bigint is expected to remain and is out of scope here) plus just check / just test / just lint.

    Repository state

    No changes made in the fix stage. git status --short --untracked-files=all and git diff --stat are empty; the branch triagebot/fix-3538 is identical to 286f32006. Triage artifacts (reproducer, control case, logs, this report) live in /tmp/vite-plus-triage/gh-3538/, outside the checkout.

    This report was made by an LLM. The analysis may be wrong, and the potential fix might not work, but is intended as a starting point for exploring the issue.

  2. added
    - P4: important
    on Nov 22, 2026
  3. self-assigned this
    on Nov 22, 2026
  4. added a commit that references this issue on Nov 23, 2026
    e961058
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

- P4: importanttriage: unable to fix

Type

Fields

Priority

None yet

Effort

None yet

Target date

None yet

Start date

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions