Summary
Workarounds
Disable dynamic uploads for the instance, e.g. from proposals.
References
OWASP ASVS v4.0.3-5.1.3
Credits
This issue was discovered in City of Helsinki's security audit against Decidim 0.27 done during September 2023. The security audit was implemented by Deloitte Finland.
Impact
The dynamic file upload feature is subject to potential XSS attach in case the attacker manages to modify the file names of the records being uploaded to the server.
This appears in sections where the user controls the file upload dialogs themselves and has the technical knowledge to change the file names through the dynamic upload endpoint. Therefore I believe it would require the attacker to control the whole session of the particular user but in any case, this needs to be fixed.
Successful exploit of this vulneratibility would require the user to have successfully uploaded a file blob to the server with a malicious file name and then have the possibility to direct the other user to the edit page of the record where the attachment is attached.
The users are able to craft the direct upload requests themselves controlling the file name that gets stored to the database as shown here:
https://github.com/rails/rails/blob/a967d355c6fee9ad9b8bd115d43bc8b0fc207e7e/activestorage/app/controllers/active_storage/direct_uploads_controller.rb#L14
The attacker is able to change the filename e.g. to <svg onload=alert('XSS')> if they know how to craft these requests themselves. And then enter the returned blob ID to the form inputs manually by modifying the edit page source.
Therefore, anywhere we display these strings, we should properly escape them.
Untrusted input is rendered as active markup in a victim's browser, which can run script in their session. Typical impact: session or credential theft, and actions taken as the user.
CVE-2023-51447 has a CVSS score of 6.3 (Medium). The vector is network-reachable, low privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (0.27.5); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Remediation advice
PR #11612 fixes this problem both for 0.28.dev and 0.27.x.
Frequently Asked Questions
- What is CVE-2023-51447? CVE-2023-51447 is a medium-severity cross-site scripting (XSS) vulnerability in decidim (rubygems), affecting versions >= 0.27.0, < 0.27.5. It is fixed in 0.27.5. Untrusted input is rendered as active markup in a victim's browser, which can run script in their session.
- How severe is CVE-2023-51447? CVE-2023-51447 has a CVSS score of 6.3 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which packages are affected by CVE-2023-51447?
decidim(rubygems) (versions >= 0.27.0, < 0.27.5)decidim-core(rubygems) (versions >= 0.27.0, < 0.27.5)
- Is there a fix for CVE-2023-51447? Yes. CVE-2023-51447 is fixed in 0.27.5. Upgrade to this version or later.
- Is CVE-2023-51447 exploitable, and should I be worried? Whether CVE-2023-51447 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2023-51447 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2023-51447?
- Upgrade
decidimto 0.27.5 or later - Upgrade
decidim-coreto 0.27.5 or later
- Upgrade