# CVE-2021-2471: Incorrect Authorization in MySQL Connector Java

> A high-privileged attacker can access critical data or cause a denial of service in MySQL Connector/J via network access.

- **Severity:** Medium 5.9 (`CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 20 Oct 2021
- **Updated:** 25 Sep 2024
- **Also known as:** CLSA-2026-1775521830, GHSA-w6f2-8wx4-47r5, SUSE-SU-2022:1142-1, UBUNTU-CVE-2021-2471, openSUSE-SU-2022:0658-1, openSUSE-SU-2024:11883-1

## What is CVE-2021-2471?

CVE-2021-2471 is a medium-severity vulnerability in Oracle Communications Cloud Native Core Policy, published on 20 Oct 2021. An attacker needs administrator access to exploit it, with no action from the victim.

### Official description

Vulnerability in the MySQL Connectors product of Oracle MySQL (component: Connector/J). Supported versions that are affected are 8.0.26 and prior. Difficult to exploit vulnerability allows high privileged attacker with network access via multiple protocols to compromise MySQL Connectors. Successful attacks of this vulnerability can result in unauthorized access to critical data or complete access to all MySQL Connectors accessible data and unauthorized ability to cause a hang or frequently repeatable crash (complete DOS) of MySQL Connectors. CVSS 3.1 Base Score 5.9 (Confidentiality and Availability impacts). CVSS Vector: (CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:H/I:N/A:H).

## Which versions are affected by CVE-2021-2471?

2 open source packages ship an affected version, including mysql:mysql-connector-java. It affects 6 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `mysql:mysql-connector-java` | Maven | From 8.0.0 | 8.0.27 |
| `mysql:mysql-connector-java` | Maven | From 8.0.0 | 8.0.27 |
| `mysql-connector-java` | SUSE:HPE Helion OpenStack 8 | All versions | 8.0.25-5.13.1 |
| `mysql-connector-java` | SUSE:Linux Enterprise Software Development Kit 12 SP5 | All versions | 8.0.25-5.13.1 |
| `mysql-connector-java` | SUSE:OpenStack Cloud 8 | All versions | 8.0.25-5.13.1 |
| `mysql-connector-java` | SUSE:OpenStack Cloud 9 | All versions | 8.0.25-5.13.1 |
| `mysql-connector-java` | SUSE:OpenStack Cloud Crowbar 8 | All versions | 8.0.25-5.13.1 |
| `mysql-connector-java` | SUSE:OpenStack Cloud Crowbar 9 | All versions | 8.0.25-5.13.1 |
| `mysql-connector-java` | openSUSE:Leap 15.3 | All versions | 5.1.47-3.6.1 |
| `mysql-connector-java` | openSUSE:Tumbleweed | All versions | 8.0.28-1.1 |

Products: Oracle Communications Cloud Native Core Console, Oracle Communications Cloud Native Core Network Slice Selection Function, Oracle Communications Cloud Native Core Policy, Oracle Communications Cloud Native Core Security Edge Protection Proxy, Oracle Mysql Connectors, Quarkus Quarkus.

## How do I fix CVE-2021-2471?

Upgrade mysql:mysql-connector-java to 8.0.27 or later.

## Is CVE-2021-2471 being exploited?

There is no known exploitation of CVE-2021-2471 in the wild and no public exploit code.

Public exploit code:

- h2-jdbc(https://github.com/h2database/h2database/issues/3195) & mysql-jdbc(CVE-2021-2471) SQLXML XXE vulnerability reproduction. (github_poc): https://github.com/SecCoder-Security-Lab/jdbc-sqlxml-xxe
- https://github.com/cckuailong/CVE-2021-2471 (github_poc): https://github.com/cckuailong/CVE-2021-2471
- PoC for CVE-2021-2471 - XXE in MySQL Connector/J (github_poc): https://github.com/DrunkenShells/CVE-2021-2471

## Other vulnerabilities in Oracle Communications Cloud Native Core Policy

- [CVE-2020-14340](https://insights.sbomify.com/CVE-2020-14340/): Uncontrolled Resource Consumption in XNIO (medium 5.9)
- [CVE-2021-22060](https://insights.sbomify.com/CVE-2021-22060/): Log entry injection in Spring Framework (medium 4.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2021-2471 and fix it if it is affected.

What it is: CVE-2021-2471 is a medium-severity vulnerability in Oracle Communications Cloud Native Core Policy, published on 20 Oct 2021. An attacker needs administrator access to exploit it, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2021-2471 in the wild and no public exploit code.

Affected packages and fixed versions:
- mysql:mysql-connector-java (Maven): affected from 8.0.0; fixed in 8.0.27
- mysql:mysql-connector-java (Maven): affected from 8.0.0; fixed in 8.0.27

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2021-2471/ (Markdown: https://insights.sbomify.com/CVE-2021-2471/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2021-2471
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2021-2471
- OSV: https://osv.dev/vulnerability/CVE-2021-2471

---
From sbomify Insights: https://insights.sbomify.com/CVE-2021-2471/
Summaries are generated and may contain mistakes; the official description above is the record.
