Skip to content

Don't wire a click to open a received .desktop file - #14853

Open
namespaceMarcello wants to merge 5 commits into
omacom:quattrofrom
namespaceMarcello:fix/taildrop-no-click-launch
Open

namespaceMarcello wants to merge 5 commits into
omacom:quattrofrom
namespaceMarcello:fix/taildrop-no-click-launch

Conversation

@namespaceMarcello

@namespaceMarcello namespaceMarcello commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

omarchy-tailscale-receive announces each arriving Taildrop file with a notification whose click opens the file through omarchy-notification-send ... --exec xdg-open "$path". A Taildrop sender chooses both the name and the contents of what it sends, and a .desktop entry is an application launcher: where something that runs launchers handles it, opening one runs its Exec= line.

This keeps the announcement but drops the click for a received file whose name ends in .desktop, in any case. The file is still saved and announced with the same glyph, urgency and text as any other, so it can be looked at. Every other file is announced exactly as on quattro: an image preview for images, the send glyph otherwise, and a click that runs xdg-open on it.

#16301 previews received images because Taildrop only accepts files from the user's own devices. A .desktop is a different case from an image: opening one runs a command instead of showing a picture, so a launcher sent from one compromised device would otherwise be one click from running on the others.

This is defense in depth with a narrow reach, and its limits are worth stating plainly:

  • On a stock install the guard changes nothing. Under Hyprland (XDG_CURRENT_DESKTOP=Hyprland, default/hypr/envs.lua:21) xdg-open runs in its generic mode and types the file with file(1), which reads a desktop entry as text/plain, so the click hands it to the text editor (text/plain=nvim.desktop, default/applications/mimeapps.list:33), never to a launcher. Omarchy sets no application/x-desktop handler, and Nautilus being installed does not change what xdg-open does here.
  • It matters where xdg-open types files from the shared MIME database (with perl-file-mimeinfo, which Make xdg-open pick file types by name, like the file manager #14854 proposes for the base set) and something that runs launchers handles application/x-desktop. Even with perl-file-mimeinfo and no such handler, a received .desktop opens as text. Whether such a handler exists depends on what the user installs; the guard does not rely on it either way.
  • The check goes by name only. In that same setup the shared MIME database also recognises a desktop entry by its content, so a launcher sent under another name (notes, x.kdelnk, or the receiver's own .desktop-1 when a second bare .desktop arrives) keeps its click.

Closing that last gap would mean reading the first bytes of each received file for [Desktop Entry], as shared-mime-info does, before deciding on the click. That reads untrusted content on arrival, a different trade-off from a name check, so it is left out here. If it is wanted, it is a short addition to this PR.

Validation: test/shell.d/tailscale-receive-test.sh reads the busctl call the notice makes. evil.desktop and Trap.DESKTOP are saved and announced with the send glyph, critical urgency and the same text as any other file, and their Notify call carries no omarchy-exec-argv hint and no copy of the path. Upstream's assertions for the other files (image preview over the send glyph, the literal ["xdg-open", path] click, spaced names, the collision rename, localized text) are unchanged and pass. Turning the guard off turns taildrop receive wires no click to a received launcher red on evil.desktop; dropping only the lowercasing turns it red on Trap.DESKTOP; dropping the announcement or giving the .desktop a different click command also turns the test red. Run side by side on 29 names (spaces, --exec, $(…), quotes, unicode, near-misses such as x.desktop.txt and x.DESKTOP.png), this receiver and quattro's make byte-identical busctl calls for every name the guard does not match. ./test/all in an Arch container after merging quattro 81fd2d2: 6395 passing checks, 69 skipped, 4 failing, and those 4 fail the same way on quattro in the same container. The xdg-open behaviour above was measured in that container with Hyprland's XDG_CURRENT_DESKTOP and stand-in handlers.

Updated 2026-10-19: merged quattro (#15326 and #13353 rewrote the notice and its test). The guard is unchanged, the two .desktop cases are redone in the new test form, and the panel README notes the exception. This description is corrected too: the earlier one said Omarchy ships no file manager, which is wrong (Nautilus is in the base set).

Updated 2026-10-25: merged quattro at 2fca7fe. #16301 brought image previews back with the send glyph and #16561 names the app so a batch stacks; the guard sits below them unchanged, so a .desktop gets neither a preview nor a click. In the test, upstream's glyph and preview checks stay and the --no-open case is added beside them, and the README sentence on previews gets the launcher clause. After the merge tailscale-receive-test.sh passes (11 checks), the four broken variants above turn it red, and the i18n-check steps pass (I18N_STRUCTURAL=1 bash test/shell.d/i18n-test.sh, 402 ok; scripts/i18n-sync.py extract-scan --check, no candidates).

Written by Claude Code (AI assistant) on behalf of @namespaceMarcello, who directs this work.

🤖 Generated with Claude Code

A Taildrop sender chooses both the name and the contents of the file it
sends. The arrival notification carried --exec xdg-open "$path" for every
file, so a single click could hand a received .desktop launcher to
xdg-open; on a desktop that honors launchers that runs its Exec line.

Announce a received .desktop the same way, but without the click-to-open
action, so taking delivery of one is never a step toward running it.
Every other file type is unchanged.

Validation: test/shell tailscale-receive — a received evil.desktop is
announced but gets no --exec xdg-open; reverting the guard turns that
assertion red.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge within its stated filename-only scope.

Summary

Received files whose names end in .desktop, regardless of case, are still saved and announced but no longer get a click command.

  • Received .desktop files arrive without a notification click action.

Reviews (4) · Last reviewed commit: "Merge quattro into the Taildrop launcher..." · Reviewed by Greptile

Comment thread test/shell.d/tailscale-receive-test.sh Resolved
The guard already lowercases the name before matching (${name,,} ==
*.desktop), so a mixed-case launcher like Trap.DESKTOP is held back, but
no test proved it. Add that case next to evil.desktop: it is announced
and gets no --exec xdg-open.

Validation: test/shell tailscale-receive — 12 checks pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for this. I read the change to bin/omarchy-tailscale-receive and test/shell.d/tailscale-receive-test.sh at 1edf62f, but have not run anything yet, because the classification step did not settle: I read it as a bug fix (a click on a Taildrop arrival notice can hand an attacker-chosen .desktop launcher to xdg-open), and the second opinion (Codex Medium) could not be asked, since omabot's review budget for today was already spent. Without two models agreeing on what this is, it gets no class label and is not verified on a worker yet.

Nothing is waiting on you. It goes round again once a second opinion is available, and then it gets the full check: a reproduction on a worker against quattro, the suite, and a review.

namespaceMarcello and others added 2 commits October 19, 2026 22:02
Since this branch was cut, omacom#15326 moved the Taildrop arrival notice's text
to omarchy-i18n and omacom#13353 gave every file the glyph instead of an image
preview; the click still opens the file with xdg-open, a .desktop included.
The guard merges cleanly onto the new notice. omacom#13353's test reads the busctl
call the notice makes, so the two .desktop cases are redone in that form:
assert_notification takes --no-open and checks that the toast carries no
omarchy-exec-argv hint and no copy of the path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Tailscale panel README says a click on the arrival notice opens the
file. A received .desktop launcher is announced without that click.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added the enhancement New feature or request label Oct 21, 2026
omacom#16301 added image previews and the send glyph to the receive toast,
and omacom#16561 named the app so files stack. The .desktop guard merged
cleanly below them; in the test, keep quattro's glyph and preview
checks and this branch's --no-open check, and in the panel README
add the launcher clause to the new sentence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants