Repository navigation
fix(desktop): drop a mailto link's fragment with frostui's rule - #201
Merged
Merged
Conversation
system.WebURL kept a mailto link's fragment, so mailto:[email protected]?subject=x#&attach=/etc/passwd reached the mail client with the attach field after the "#", which a client that does not split off the fragment reads as a field. frostui v0.4.0 has the rule (SanitizeMailto, its ADR-0010), and WebURL now calls it in place of its own filter: it keeps to, cc, bcc, subject and body and drops the rest, the fragment included. The window checks every link it opens with WebURL, so the editor's, the reading view's and a page preview's links are tested on what they open; frostui's Opener checks it again. Fixes #200.
# Conflicts: # .memory/corrections.jsonl
frostyard-machines
approved these changes
Nov 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #200.
The bug:
system.WebURLkept amailtolink's fragment. Somailto:[email protected]?subject=x#&attach=/etc/passwdreached the mail client with#&attach=/etc/passwdstill on it, and a client that parses the query without splitting off the fragment reads that as anattachfield.This PR:
SanitizeMailto, frostui's ADR-0010.packaging/flatpak/go-sources.jsonis regenerated (make flatpak-sources), and AGENTS.md updated.WebURLkeeps the app's own scheme rule (http and https with a host, and mailto) and its messages, and passes amailtolink tofrostui.SanitizeMailto. That keepsto,cc,bcc,subjectandbodyin any ASCII case, and drops everything else: other fields, encoded names, fields without=, the fragment and a lone?. Plan 0009 (Phase 7) asked for this once frostui had the rule.App.openExternalnow callsWebURL. Live preview, source mode, the reading view and page previews all follow web links through it, so a window test can see what each path opens.cmd/frostnotesthen opens the result withfrostui.Opener{}, which checks it again.docs/design/app.mdsays the mailto rule is frostui's, and plan 0009's Phase 7 records the change.Risk tier
Risk tier: 3.
internal/desktop/system/open.gomatches the L1 glob for the links and files the app opens. The change is safe:=.cfg.OpenURL, and frostui'sOpenerapplies it again, so it now runs twice where it ran once.go.mod,go.sumandpackaging/flatpak/go-sources.jsonchange only frostui's version.Verification
make checkgreen (host)./internal/desktop/window/and./internal/desktop/system/;make desktop-buildmake flatpak-sourcesrungo test -count=1 -run 'TestWebURLs|TestAMailtoLinkOpensWithoutWhatItHides|TestAPagePreviewsLinkFollowsTheOpenRules' ./internal/desktop/system/ ./internal/desktop/window/:main'sopen.go(812bc59):TestWebURLsfails on the four new cases. The two window tests openmailto:[email protected]?subject=x#&attach=/etc/passwd.open.gowithmain'sopenExternal: the window tests receive the raw link,attach=/etc/shadowand the fragment included..memory/corrections.jsonlline addedThe tests:
TestWebURLs: every case it had, plus mailto filter keeps the fragment, so #&attach= gets through #200's link, a fragment alone, a field without=, and a lone?.TestAMailtoLinkOpensWithoutWhatItHidesclicks a link withattach=/etc/shadowin its query and#&attach=/etc/passwdafter it, first in live preview and then in the reading view. Both openmailto:[email protected]?subject=x.TestAPagePreviewsLinkFollowsTheOpenRulesnow checks that same opened URL, rather than only that something opened.