Description
In versions of the url crate through 2.5.8, url::Url::origin recursively computes the origin of nested blob: URLs. Deep nesting can exhaust the call stack. url::quirks::origin calls the same function.
Potential impact
In a service that computes the origin of externally supplied URLs, a stack overflow terminates the entire process and interrupts other requests.
Remediation
Update url to 2.5.9 or later. The fixed version computes the origin of a blob: URL without recursion.
Examples
These Cargo.toml examples show how to select the fixed release.
Before
toml
[dependencies]
url = "=2.5.8"
After
toml
[dependencies]
url = "2.5.9"
Check that Cargo.lock contains the fixed version and rebuild.