Repository navigation
Description
Problem
Paste title writes a page's title into a document that others read. A title that looks like another site's address would hide where the link goes. Review rounds found four ways a title could get past the first check, which only compared a URL-shaped title with the link's host:
- A decoded file name. A link to
evil.example/x/paypal.com%2Flogin.zipdecodes to the file namepaypal.com/login.zip, which reads as a paypal.com address. - A too-wide file-name exemption.
archive.zipandREADME.mdread as domains, because.zipand.mdare also top-level domains. An exemption for the link's own file name was needed, but in its first form it also letpaypal.com.zipthrough. - An email address. linkify types
[email protected]as an email, not a URL, so the host check never ran. - A full URL in a file name.
https%3A%2F%2Fpaypal.com%2Fa.zipdecodes tohttps://paypal.com/a.zip.
What was built
All in extensions/extension-hyperlink/src/paste-title/cleanTitle.ts:
- A title that is one address on another host keeps the URL.
- A link's own file name may pass when its extension is also a domain ending:
FILE_EXTENSION_TLDS(.zip,.mov,.md,.py,.rs,.sh,.ai,.ps,.pl,.so).PLAIN_FILE_NAME_RErequires one word, one dot and the extension, with no/,\,?,#,@or:. - An email-address title counts as its domain. It keeps the URL unless that domain is the link's own host (ignoring
www.).
The rules are documented in extensions/extension-hyperlink/docs/paste-title.md (item 4 of the cleaning list) and extensions/extension-hyperlink/AGENTS.md (the "Cleaner order" bullet).
Accepted, by maintainer ruling (2026-11-04)
evil.example/paypal.zipcan readpaypal.zip. It names the link's own file, not a known site, and the hovercard shows the real host.- A file name with two dots, such as
v1.2.zip, keeps its URL. - A file link with no extension shows its last path part.
Do not widen the exemption to every own file name: a page at evil.example/paypal.com titled paypal.com would then pass.
Commits
67fb338d1fix(extension-hyperlink): keep a link's own file name as its title47e78fb5ffix(extension-hyperlink): refuse a file name that hides an addressd3cae0a7efix(extension-hyperlink): refuse an email title on another domain
How to test
cd extensions/extension-hyperlink && bun test src/paste-title. The table tests in src/paste-title/__tests__/cleanTitle.test.ts cover every case above. Each rule was proved by sabotage: removing it makes its rows fail.
Done when
- Each rule has table tests, proved by sabotage.
- Pushed.
- Released in the next
@docs.plus/extension-hyperlinkversion. Follow.agents/skills/release-extensions/SKILL.md. The changes sit under[Unreleased]inextensions/extension-hyperlink/CHANGELOG.md, with the hovercardrenderoption from RFC: Desktop hyperlink hovercard #242.
Part of #681.
Activity
docs: align the link docs with the shipped code
HMarzban commentedon Nov 4, 2026
Status, 2026-11-04. The earlier "not pushed yet" note is out of date. The work is on
mainin4e1aca058, and deploy run41854096960shipped it.Left:
@docs.plus/extension-hyperlink2.3.0, following.agents/skills/release-extensions/SKILL.md.