CVE-2023-25330 MyBatis-Plus vulnerable to SQL injection via TenantPlugin

Critical 9.8 Published Updated

Remote attackers can execute arbitrary SQL commands via tenant ID in MyBatis Plus if the application is misconfigured.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2023-25330?

CVE-2023-25330 is a critical SQL injection vulnerability in n/a, published on 5 Apr 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

A SQL injection vulnerability in Mybatis plus below 3.5.3.1 allows remote attackers to execute arbitrary SQL commands via the tenant ID valuer. NOTE: the vendor's position is that this can only occur in a misconfigured application; the documentation discusses how to develop applications that avoid SQL injection.

Weakness: CWE-89

Which versions are affected by CVE-2023-25330?

2 open source packages ship an affected version, including com.baomidou:mybatis-plus. It affects 1 product.

PackageAffectedFixed in
com.baomidou:mybatis-plus MavenAll versions3.5.3.1
com.baomidou:mybatis-plus MavenAll versions3.5.3.1

Products include Mybatis Mybatis.

How do I fix CVE-2023-25330?

Upgrade com.baomidou:mybatis-plus to 3.5.3.1 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-2023-25330 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-25330 exists.

Sources

Also known as GHSA-32qq-m9fh-f74w, OESA-2023-1996, OESA-2023-1997, OESA-2023-1998.

Is CVE-2023-25330 in your software?

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

Check your SBOMs for free