Skip to content

fix: file names in the question become Telegram links (README.md → https://README.md) #23

Closed

Description

@groupsky

Problem

In the Apply question, the "Changed files" list shows file names as plain text. Telegram turns a name that looks like a domain into a link. Seen on 2026-11-16 with v0.1.0: README.md was shown as a link to https://README.md (.md is a real top-level domain).

A commit decides its own file names, so a hostile commit can add a file named like a real site (for example login.example.com or docs.example.org/setup). The owner sees a clickable link in a trusted message from their own bot, right next to the Apply button. The name itself is not wrong to show, but it must not become a link.

broker.toml and known_hosts stay plain text because Telegram does not link them, so the bug shows only with some names.

Proposal

Show every path from the commit inside <code>…</code> (HTML parse mode), with the HTML escaped as now: the watched-path warnings already do this. Do the same for any other text taken from the commit that is not already in <code> or <pre> (commit subjects, too: a subject can hold a URL).

Also send the questions with link previews off (link_preview_options: {is_disabled: true}), so a link that slips through still shows no preview.

Done when

  • A test: a changed file named README.md and one named login.example.com are both inside <code> in the question text.
  • A test: a commit subject with https://example.com is inside <code> or escaped so that Telegram does not link it (check the entities rule in the code comment).
  • Questions and notices are sent with link previews off; a test checks the request body against the fake Telegram server.
  • THREAT-MODEL.md names this (hostile file names or subjects shown as links in a trusted message).

Activity

  1. groupsky commented on Nov 17, 2026

    @groupsky
    ContributorAuthor

    Fixed in #37 together with #29 (squash commit 44afa8b).

    • README.md and login.example.com inside in the question: TestHostileCommitTextIsOnlyCode (checks <code>README.md</code> and <code>login.example.com</code>) and TestRepoTextIsOnlyInsideCode.
    • A subject with https://example.com is inside : same tests (each subject is one <code> line; Telegram makes no link inside , see the comment on message.Code).
    • Link previews off for questions and notices, checked on the request body: TestLinkPreviewsAreOff.
    • THREAT-MODEL.md T3 names it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority: lowDo when nothing else waits

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions