CVE-2021-27906: Uncontrolled Memory Allocation in Apache PDFBox

org.apache.pdfbox:pdfbox Updated 02 Oct 2025

Summary

13/05/2021
Yes i
Moderate
5.5

CVE-2021-27906: Uncontrolled Memory Allocation in Apache PDFBox. Affects org.apache.pdfbox:pdfbox versions >= 2.0.0, < 2.0.23. Fixed in 2.0.23. How to fix ↓

Also tracked for

The same CVE-2021-27906 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

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 Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Apache PDFBox is an open-source Java library for working with PDF documents. It provides functionality for creating, manipulating, and extracting content from PDF files. The library is widely used in various applications and frameworks that require PDF processing capabilities. However, versions 2.0.22 and prior of Apache PDFBox are vulnerable to an uncontrolled memory allocation issue.

Vulnerability Detail

The vulnerability arises when a specially crafted PDF file is loaded, triggering an OutOfMemory-Exception. An attacker can exploit this vulnerability by enticing a user to open a malicious PDF file, potentially leading to a denial-of-service condition. The issue has a CVSSv3 score of 5.5, indicating a moderate severity level. The vulnerability is tracked as CVE-2021-27906 and has been reviewed by GitHub. The Common Weakness Enumeration (CWE) ID associated with this vulnerability is CWE-789.

How To Fix

Minimum fixed version

2.0.23

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 essential to apply the recommended fix by upgrading to the patched version of Apache PDFBox.

Conclusion

The uncontrolled memory allocation vulnerability in Apache PDFBox can be mitigated by upgrading to version 2.0.23 or later. It is crucial to promptly apply the fix to prevent potential denial-of-service attacks. For further assistance with vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for org.apache.pdfbox:pdfbox →

Share this vulnerability

FAQ

Apache PDFBox is a Java library for working with PDF documents. It provides functionality for creating, manipulating, and extracting content from PDF files.

The vulnerability can be exploited by an attacker to cause an OutOfMemory-Exception, potentially leading to a denial-of-service condition.

The vulnerability has a CVSSv3 score of 5.5, indicating a moderate severity level.

To fix this vulnerability, upgrade to Apache PDFBox version 2.0.23 or later.

No, there is no known workaround for this vulnerability. It is recommended to apply the fix by upgrading to the patched version of Apache PDFBox.

Related vulnerabilities

Recent vulnerabilities recorded for org.apache.pdfbox:pdfbox.

How To Fix

Minimum fixed version

2.0.23

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