fix(previews): no genuine preview card for a site a deceptive link only pretends to be (#286) #404
Merged
jared
merged 1 commits from 2026-10-18 06:15:47 -04:00
fix/preview-deceptive-links into lotus
No Reviewers
Labels
Clear labels
a11y
area: appearance
area: auth-session
area: build-ci
area: calls
area: desktop
area: media
area: messaging
area: mobile
area: moderation
area: navigation
area: notifications
area: settings
area: threads
bug
dependencies
docs
duplicate
enhancement
help wanted
invalid
needs-human-review
performance
planning
priority: critical
priority: high
priority: low
priority: medium
qa
question
research
security
tech-debt
ux
wontfix
Accessibility: keyboard, screen reader, contrast, motion
Client area: appearance
Client area: auth-session
Client area: build-ci
Client area: calls
Client area: desktop
Client area: media
Client area: messaging
Client area: mobile
Client area: moderation
Client area: navigation
Client area: notifications
Client area: settings
Client area: threads
Something is not working
Third-party package versions and advisories
README / LOTUS_* docs wrong or missing
This issue or pull request already exists
New feature
Need some help
Something is wrong
Re-render storms, leaks, heavy work on hot paths
Data loss, security hole, or crash on a main path
Broken feature or serious usability problem
Minor issue or polish
Wrong behaviour in an edge case or notable degradation
Manual QA: shipped, needs a human in a real environment
More information is needed
XSS, unsafe URLs, data leaks, auth/session
Code health, dead code, fragile patterns
Usability or visual inconsistency
This won't be fixed
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: LotusGuild/cinny#404
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fixes #286.
URL previews are built from the plain
body, but clicks followformatted_body'shrefs, and a sender controls both. A link whose text readshttps://paypal.combut points tohttps://evil.example/loginwas caught by the click confirmation (#122), yet the message still showed a genuine PayPal preview card.Change: new
previewUrlsFor(urls, formattedBody). It runs every<a>informatted_bodythroughanalyzeLink, and drops any body URL whose site is only claimed by a mismatched link's text. Honest links and other URLs in the same message keep their previews. It's used by all three message renderers (text, notice, emote).Verified (Chromium, preview fixture for PayPal; Bob sends
pay here <a href="https://evil.example/login">https://paypal.com</a>):Unit tests: deceptive → no preview; honest link (www.paypal.com) → preview; no HTML → unchanged; mixed message → only the deceptive one dropped.
tscclean · unit tests pass · ESLint clean.🤖 Generated with Claude Code
https://claude.ai/code/session_017PCb59uY3UKqDqt7B6hzd5