RUSTSEC-2026-0592: Stack overflow in `Url::origin()` on nested `blob:` URLs

未關閉 適合新手
#45 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
1/5
預估耗時
1 小時以內
新手友好度
68/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
rust

研究方向

修復方式是升級相依套件:url crate 必須從 2.5.8 升級到至少 2.5.9,因此請先從 Cargo.toml 和 lock 檔案中的 url 項目開始。執行 cargo update -p url,接著確認解析後的版本為 2.5.9 或更高,並且建置與測試仍然通過。完成標準是 lock 檔案將 url 解析為已修補的版本,沒有新的警告,且該安全公告不再適用於本專案。

由索引模型根據 Issue 內容生成。

描述

Stack overflow in Url::origin() on nested blob: URLs

Details
Package url
Version 2.5.8
URL https://github.com/servo/rust-url/pull/1186
Date 2026-11-20
Patched versions >=2.5.9

In url 2.5.8 and earlier, Url::origin() handled a blob: URL by parsing its path as another URL and calling itself on the result. It did so regardless of the inner URL's scheme, blob included. Each blob: prefix cost one stack frame, with no limit on nesting depth. Url::parse() accepts a URL with 10,000 blob: prefixes followed by https://example.com/ (50,020 bytes in total); calling Url::origin() on it overflowed the default 2 MiB stack of a spawned thread.

A stack overflow aborts the whole process, and catch_unwind() does not catch it. One such URL crashes any program that calls Url::origin() on untrusted input. url::quirks::origin() also calls Url::origin(). For example, Servo's URL.origin DOM getter calls url::quirks::origin(), so a script on a page can trigger the overflow.

url 2.5.9 follows the URL Standard: Url::origin() takes the origin of the inner URL only when its scheme is http, https, or file, returns an opaque origin otherwise, and never calls itself. A blob: URL with another inner scheme that previously produced a tuple origin, such as blob:ws://... or blob:blob:https://..., now returns an opaque origin.

See advisory page for additional details.

主要語言
Rust
星號
2
分支
0
平均合併
1 小時 25 分鐘
30 天內合併 PR
1

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

stackabletech/stackable-odbc-trino 的其他 Issue

查看 stackabletech/stackable-odbc-trino 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。