Skip to content

Untrusted page titles are rendered as Rich markup in the tab bar (MarkupError / style injection) #14

Description

@CryptoJones

Location: src/perplexity_agent/tui/app.py:127

_refresh_tabbar interpolates the fetched page <title> into Static.update(f"...{t.title[:22]}..."). Static defaults to markup=True, so the title is parsed as Rich console markup.

Failure scenario: /open a page titled [2026] Best GPU deals (or any title whose bracket pair the [:22] truncation splits) — Text.from_markup raises MarkupError, aborting the handler and breaking every subsequent tab-bar refresh while the tab stays open. Attacker-controlled titles can also inject tags like [blink] into the UI.

Suggested fix: escape with rich.markup.escape() (or construct the bar with markup=False / Text objects).

Found by /code-review (high effort).

Activity

  1. CryptoJones commented on Jun 15, 2026

    @CryptoJones
    OwnerAuthor

    Fixed: _refresh_tabbar escapes the title via rich.markup.escape (tui/app.py:139).

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 working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions