CVE-2020-26945: Deserialization errors in MyBatis

org.mybatis:mybatis Updated 02 Oct 2025

Summary

22/04/2021
Yes i
High
8.1

CVE-2020-26945: "Deserialization errors in MyBatis". Affects org.mybatis:mybatis versions < 3.5.6. Fixed in 3.5.6. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

MyBatis is a popular Java persistence framework that provides a convenient way to interact with databases using SQL statements. It simplifies the process of mapping Java objects to database records and vice versa. MyBatis is widely used in enterprise applications to handle database operations efficiently. However, versions before 3.5.6 are susceptible to deserialization errors, which can lead to potential cache poisoning.

Vulnerability Detail

The vulnerability in MyBatis arises from mishandling deserialization of object streams. This can be exploited by an attacker to manipulate the cache and potentially execute arbitrary code. By crafting a malicious object stream, an attacker can poison the cache and compromise the integrity and confidentiality of the application. This vulnerability is rated as HIGH severity with a CVSS score of 8.1. The Common Weakness Enumeration (CWE) ID associated with this vulnerability is CWE-502.

How To Fix

Minimum fixed version

3.5.6

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no known workaround for this vulnerability. It is crucial to update to the patched version of MyBatis to mitigate the risk of cache poisoning and potential code execution.

Conclusion

The deserialization errors in MyBatis versions before 3.5.6 pose a significant risk of cache poisoning and potential code execution. It is crucial to update to the patched version to mitigate these vulnerabilities. Vulnerability monitoring tools like Vulert can help you stay informed about such vulnerabilities and take proactive measures to secure your application.

See every vulnerability recorded for org.mybatis:mybatis →

Share this vulnerability

FAQ

MyBatis is a Java persistence framework that simplifies database operations by providing a convenient way to map Java objects to database records using SQL statements.

Cache poisoning refers to the manipulation of a cache's contents by an attacker to introduce malicious data. In the context of this vulnerability, an attacker can exploit deserialization errors to poison the MyBatis cache and potentially execute arbitrary code.

This vulnerability can lead to cache poisoning, compromising the integrity and confidentiality of the application. An attacker can potentially execute arbitrary code, leading to further exploitation and unauthorized access to sensitive data.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability. Vulert provides real-time monitoring and alerts for open-source vulnerabilities without requiring access to the code or installation.

For further support on vulnerability remediation, you can reach out to info@devnack.com. Our team will be happy to assist you in addressing this vulnerability and ensuring the security of your application.

How To Fix

Minimum fixed version

3.5.6

This is the first release that contains the fix.

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback