CVE-2021-21380 Rating Script Service expose XWiki to SQL injection

High 7.7 Published Updated

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.

PackageAffectedFixed in
org.xwiki.platform:xwiki-platform-ratings-api MavenAll versions12.9
org.xwiki.platform:xwiki-platform-ratings-api MavenAll versions12.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.

All Xwiki Xwiki vulnerabilities

Sources

Also known as GHSA-79rg-7mv3-jrr5.

Is CVE-2021-21380 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free