Skip to content

deps: fix the webbrowser argument-injection advisory (RUSTSEC-2026-0257) - #3

Merged
luka-loehr merged 1 commit into
mainfrom
fix/webbrowser-advisory
Aug 18, 2026
Merged

deps: fix the webbrowser argument-injection advisory (RUSTSEC-2026-0257)#3
luka-loehr merged 1 commit into
mainfrom
fix/webbrowser-advisory

Conversation

@luka-loehr

Copy link
Copy Markdown
Collaborator

CLI CI has been red on main since this advisory published. Unlike the other SDK CI failures I cleared today, this one is not ambient — it is reachable here.

webbrowser 1.2.1 substitutes the caller's URL into the BROWSER template before tokenising on whitespace, so a non-http(s) URL whose parsed form retains spaces smuggles extra arguments into the launched browser. --remote-debugging-port (exposes a local DevTools endpoint) and --proxy-server (redirects browser traffic) were both demonstrated against Chromium.

Two of this CLI's three webbrowser::open call sites open a URL that came from a server response — the device-flow verification_uri_complete in auth/device.rs and the link in main.rs. Only the OAuth authorize URL is locally constructed.

  • Bumps to 1.2.4 (fixed in 1.2.2).
  • Turns on the crate's hardened feature, which refuses non-http(s) URLs outright. Every URL this CLI opens is https, so it costs nothing and removes the input class the advisory depends on.

cargo deny --locked check → advisories ok, bans ok, licenses ok, sources ok. cargo fmt --check, cargo clippy --locked --all-targets --all-features -- -D warnings, cargo test --locked --all-features (290 passed / 0 failed) and the --no-default-features --features tls-rustcrypto check all pass.

webbrowser 1.2.1 substituted the caller's URL into the BROWSER template
BEFORE tokenising on whitespace, so a non-http(s) URL whose parsed form
keeps spaces could smuggle extra arguments into the launched browser —
`--remote-debugging-port` and `--proxy-server` were both demonstrated
against Chromium.

This is not theoretical for the CLI. Of the three `webbrowser::open` call
sites, two open a URL that came from a server response: the device-flow
`verification_uri_complete` (auth/device.rs) and the link returned by the
open-in-browser command (main.rs). Only the OAuth authorize URL is built
locally.

Bumps to 1.2.4, which tokenises before substituting, and turns on the
crate's `hardened` feature as defence in depth: every URL this CLI opens is
https, so refusing every other scheme costs nothing.

cargo deny (advisories, bans, licenses, sources) ok; fmt, clippy
-D warnings, 290 tests, and the no-default-features TLS combo all pass.
@luka-loehr
luka-loehr merged commit 2cf23dd into main Aug 18, 2026
1 check passed
@luka-loehr
luka-loehr deleted the fix/webbrowser-advisory branch August 18, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant