Remote Code Execution (RCE) Affecting com.mysql:mysql-connector-j package, versions [,8.0.33)


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.07% (33rd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Remote Code Execution (RCE) vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JAVA-COMMYSQL-5441540
  • published21 Apr 2023
  • disclosed21 Apr 2023
  • creditGoogle OSS-Fuzz

Introduced: 21 Apr 2023

CVE-2023-21971  (opens in a new tab)
CWE-94  (opens in a new tab)

How to fix?

Upgrade com.mysql:mysql-connector-j to version 8.0.33 or higher.

Overview

Affected versions of this package are vulnerable to Remote Code Execution (RCE) due to insufficient checks in the java.sql.DriverManager.getConnection() method when used with untrusted inputs.

PoC

conn = DriverManager.getConnection("jdbc:mysql://localhost/test?" + "user=test&password=test&propertiesTransform=com.example.MyArbitraryClass");

In this example, the static analyzer of com.example.MyArbitraryClass will be executed, even if the class does not implement the ConnectionPropertiesTransform interface.

References

CVSS Scores

version 3.1