CVE-2021-21380 Rating Script Service expose XWiki to SQL injection
Attackers with Script rights can inject SQL via the Rating Script Service in XWiki if the Ratings API is installed, allowing data access or modification.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2021-21380?
CVE-2021-21380 is a high-severity SQL injection vulnerability in Xwiki Xwiki, published on 23 Mar 2021. Any signed-in user can exploit it over the network, with no action from the victim.
Official description
XWiki Platform is a generic wiki platform offering runtime services for applications built on top of it. In affected versions of XWiki Platform (and only those with the Ratings API installed), the Rating Script Service expose an API to perform SQL requests without escaping the from and where search arguments. This might lead to an SQL script injection quite easily for any user having Script rights on XWiki. The problem has been patched in XWiki 12.9RC1. The only workaround besides upgrading XWiki would be to uninstall the Ratings API in XWiki from the Extension Manager.
Weakness: CWE-89
Which versions are affected by CVE-2021-21380?
2 open source packages ship an affected version, including org.xwiki.platform:xwiki-platform-ratings-api. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
org.xwiki.platform:xwiki-platform-ratings-api Maven | All versions | 12.9 |
org.xwiki.platform:xwiki-platform-ratings-api Maven | All versions | 12.9 |
Products include Xwiki Xwiki.
How do I fix CVE-2021-21380?
Upgrade org.xwiki.platform:xwiki-platform-ratings-api to 12.9 or later.
Use parameterised queries everywhere and never build SQL by joining strings. Upgrade affected software first; a web application firewall only buys time. More about SQL injection.
Is CVE-2021-21380 being exploited?
There is no known exploitation of CVE-2021-21380 in the wild and no public exploit code.
Public exploit code: 1 proofs of concept on GitHub.
Other vulnerabilities in Xwiki Xwiki
- CVE-2025-24893 XWiki Platform Eval Injection
- CVE-2025-53836 XWiki Rendering is vulnerable to RCE attacks when processing nested macros
- CVE-2024-55662 XWiki allows remote code execution through the extension sheet
- CVE-2024-55877 XWiki allows remote code execution from account through macro descriptions and XWiki.XWikiSyntaxMacrosList
- CVE-2024-37901 XWiki Platform vulnerable to remote code execution from account via SearchSuggestConfigSheet
Sources
Also known as GHSA-79rg-7mv3-jrr5.