What’s Vulnerable › Vulnerabilities
CVE-2023-30538: Stored Cross-site Scripting via improper sanitization of svg files in Discourse
- Severity: medium (CVSS 5.4 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.4% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2023-04-18 · updated 2026-06-17
- Weakness: CWE-79
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).
Affected products
- discourse: through 3.0.2; before 3.1.0; 3.1.0-beta1, 3.1.0-beta2, 3.1.0-beta3 — fixed in 3.1.0
How to fix
Upgrade to a fixed version: discourse 3.1.0. Check the vendor advisory for mitigations.
References
- https://github.com/discourse/discourse/security/advisories/GHSA-w5mv-4pjf-xj43
- https://github.com/discourse/discourse/security/advisories/GHSA-w5mv-4pjf-xj43
Get alerted when CVE-2023-30538 or the next vulnerability affects your stack