Repository navigation
[Security] Keep web app launchers on http(s) - #8496
Conversation
Chromium --app= will run javascript:, file:, and data: URLs. Prefix schemeless input with https as before, then refuse anything else.
There was a problem hiding this comment.
Pull request overview
Restricts installed web-app URLs to HTTP(S) schemes and adds regression tests.
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
Changes:
- Centralizes URL normalization and scheme validation.
- Tests valid, schemeless, custom-command, and prohibited URLs.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
bin/omarchy-webapp-install |
Adds HTTP(S)-only URL validation. |
test/shell.d/webapp-install-test.sh |
Adds installer URL tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The scheme check ran after the interactive branch, which had already handed the URL to curl: a refused `file://` or `ftp://` URL was dereferenced first, the whole string went out to Google's favicon endpoint in a `domain=` query, and a fetch that happened to succeed left an orphan icon and a rebuilt icon cache behind. Validating immediately after normalization puts the refusal ahead of every dereference in both branches. A leading space also kept the URL out of the scheme test entirely. `normalize_webapp_url` saw no scheme, prefixed it, and ` file:///etc/passwd` became `https:// file:///etc/passwd`, which passes `^https?://`. The desktop `Exec` field is unquoted, so it splits back into two arguments, and `omarchy-launch-webapp` forwards everything after the first to the browser, where a bare argument is another URL to open. Refusing whitespace closes that without touching desktop-entry escaping. Scheme comparison is case-insensitive because schemes are: `HTTPS://example.com` installed before this check existed and has no reason to stop. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-Authored-By: Codex XHigh <noreply@openai.com>
|
Reviewed this on a worktree at The scheme check ran too late. It sat after the argument/interactive split, so the interactive path had already dereferenced the URL by the time it fired. Entering A single leading space walked past the check.
Codex also noted the On what I checked: One thing left for you: the The rest holds up. 🤖 Generated by Opus 5 in Claude Code. |
(cherry picked from commit 0b3f1b7)
Fixes #8495.
omarchy-webapp-installprefixes a schemeless URL withhttps://. It now validates the normalized URL before any fetch or icon write:http://andhttps://schemes are accepted;The whitespace rule closes the reported Chromium flag injection:
omarchy-webapp-install InjectTest 'https://example.com/ --user-agent=INJECTION_PROOF_MARKER_12345' chromiumBefore the layered fix, the Desktop Entry parser split the value and
omarchy-launch-webappforwarded the extra flag to Chromium. #8473 also serializes every default URL as one correctly quoted Desktop Entry argument, while #7984 keeps app names out of the launcher directory structure.Verification
test/shell.d/webapp-install-test.shproves that:javascript:,file:,data:, FTP, and extension schemes are refused;--user-agentpayload are refused;curlruns or an icon/launcher is written.The combined #7984 + #8473 + #8496 regression suites pass.