CVE-2021-28657: Tika Infinite Loop Vulnerability
MODERATECVE-2021-28657 is a MODERATE (CVSS 5.5) infinite loop vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Tika libraries in the Maven ecosystem. The issue involves infinite loop in apache tika. Remediation is available by upgrading affected packages to version 1.26.
CVE-2021-28657 at a Glance
Security Impact
CVSS: 5.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H).
How to Fix CVE-2021-28657
To remediate this vulnerability, upgrade all affected Tika dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
<dependency>
<groupId>org.apache.tika</groupId>
<artifactId>tika</artifactId>
<version>1.26</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=org.apache.tika
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2021-28657, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=org.apache.tika
Analyze the terminal output to locate any version of Tika in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.26), your application is affected.
Note: The mvn dependency:tree -Dincludes=org.apache.tika command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Tika, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2021-28657 Affected Tika Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.apache.tika:tika
|
Maven |
< 1.26
|
1.26
|
References
Frequently Asked Questions
What is CVE-2021-28657?
Which Tika versions are affected?
What version fixes CVE-2021-28657?
Is tika affected?
What is the CVSS score of CVE-2021-28657?
What CWE is associated with CVE-2021-28657?
How can I check Maven dependencies for CVE-2021-28657?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-567x-m4wm-87v8",
"modified" : "2022-04-22T15:50:03Z",
"published" : "2021-05-10T15:23:25Z",
"aliases" : [ "CVE-2021-28657" ],
"summary" : "Infinite loop in Apache Tika",
"details" : "A carefully crafted or corrupt file may trigger an infinite loop in Tika's MP3Parser up to and including Tika 1.25. Apache Tika users should upgrade to 1.26 or later.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.tika:tika"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.26"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "< 1.25"
}
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-28657"
}, {
"type" : "WEB",
"url" : "https://lists.apache.org/thread.html/r4cbc3f6981cd0a1a482531df9d44e4c42a7f63342a7ba78b7bff8a1b@%3Cnotifications.james.apache.org%3E"
}, {
"type" : "WEB",
"url" : "https://lists.apache.org/thread.html/r915add4aa52c60d1b5cf085039cfa73a98d7fae9673374dfd7744b5a%40%3Cdev.tika.apache.org%3E"
}, {
"type" : "WEB",
"url" : "https://security.netapp.com/advisory/ntap-20210507-0004"
}, {
"type" : "WEB",
"url" : "https://www.oracle.com/security-alerts/cpuapr2022.html"
}, {
"type" : "WEB",
"url" : "https://www.oracle.com/security-alerts/cpuoct2021.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-400", "CWE-835" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2021-04-01T00:18:03Z",
"nvd_published_at" : "2021-03-31T08:15:00Z"
}
}