XML External Entity Injection Vulnerability in libtwelvemonkeys-java: Critical Security Flaw

libtwelvemonkeys-java Updated 02 Oct 2025

Summary

06/05/2022
N/A
Yes i
Unrated
Not published

DEBIAN-CVE-2021-23792: The package com.twelvemonkeys.imageio:imageio-metadata before 3.7.1 are vulnerable to XML External Entity (XXE) Injection due to an insecurely initialized XML parser for reading XMP Metadata. Affects libtwelvemonkeys-java versions < 3.8.0-1. Fixed in 3.8.0-1. 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

libtwelvemonkeys-java is a Java library that provides a set of image processing utilities, including support for various image formats and metadata handling. It is widely used in applications that require image manipulation and metadata extraction. However, prior to version 3.8.0-1, the library is susceptible to an XML External Entity (XXE) injection vulnerability, which can be exploited when processing XMP metadata from images.

Vulnerability Detail

The vulnerability arises from an insecurely initialized XML parser used in the com.twelvemonkeys.imageio:imageio-metadata package, specifically before version 3.7.1. This flaw allows attackers to craft malicious XMP segments within image files. When these files are processed, the XML parser can be tricked into accessing unauthorized resources, leading to potential data exposure or denial of service. The risk is particularly high when user-uploaded images are involved, as attackers can exploit this vulnerability by uploading specially crafted images.

How To Fix

Minimum fixed version

3.8.0-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade libtwelvemonkeys-java

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

Workaround

If immediate updating is not feasible, a temporary workaround involves validating and sanitizing any uploaded images before processing them. This can help prevent malicious files from being processed by the XML parser. Additionally, consider disabling XML parsing for untrusted sources until the package is updated.

Conclusion

The libtwelvemonkeys-java package has a critical vulnerability related to XML External Entity injection, which can be exploited through malicious XMP metadata in images. It is crucial to update to the patched version 3.8.0-1 or later to safeguard against potential attacks. Implementing workarounds can provide temporary relief until the update is applied.

See every vulnerability recorded for libtwelvemonkeys-java →

Share this vulnerability

FAQ

The vulnerability is an XML External Entity (XXE) injection flaw that allows attackers to exploit insecure XML parsing when processing XMP metadata in images.

You can check if your application is affected by using Vulert, which monitors open-source vulnerabilities in your software. Visit Vulert Scanner to analyze your manifest file.

Exploitation of this vulnerability can lead to unauthorized access to sensitive data, denial of service, or other security breaches, especially when processing user-uploaded images.

Yes, you can implement validation and sanitization of uploaded images to prevent malicious files from being processed, and disable XML parsing for untrusted sources.

You can find more information about the library and its functionalities on its official documentation or repository pages.

Related vulnerabilities

Recent vulnerabilities recorded for libtwelvemonkeys-java.

How To Fix

Minimum fixed version

3.8.0-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade libtwelvemonkeys-java

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