CVE-2021-31812
A carefully crafted PDF file can trigger an infinite loop while loading the file
Check your servers for CVE-2021-31812
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2021-31812 affects a package, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
Description
In Apache PDFBox, a carefully crafted PDF file can trigger an infinite loop while loading the file. This issue affects Apache PDFBox version 2.0.23 and prior 2.0.x versions.
Exploitation
EPSS 3.05%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 87.9% of all scored CVEs. Scores of 2 Dec 2026.
Weakness
- CWE-834 Excessive Iteration
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| Apache PDFBox |
affected from Apache PDFBox, before 2.0.24
|
Is my server affected?
Find the installed version of the package (replace PACKAGE with its name) and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.
Debian, Ubuntu
dpkg -l | grep -i PACKAGE
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2021-31812 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2021-31812RHEL, Rocky, Alma, Fedora
rpm -q PACKAGE
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2021-31812Alpine
apk list --installed | grep -i PACKAGEWith Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2021-31812
trivy image --scanners vuln IMAGE | grep CVE-2021-31812
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Advisories
- FEDORA-2021-4a9ead5fff lists.fedoraproject.org · vendor advisory
- FEDORA-2021-3d94c14be4 lists.fedoraproject.org · vendor advisory
Other references
- https://lists.apache.org/thread.html/ra2ab0ce69ce8aaff0773b8c1036438387ce004c2afc6f066626e205e%40%3Cusers.pdfbox.apache.org%3E lists.apache.org · mailing list
- [announce] 20210612 CVE-2021-31812: Apache PDFBox: A carefully crafted PDF file can trigger an infinite loop while… lists.apache.org · mailing list
- [oss-security] 20210612 CVE-2021-31812: Apache PDFBox: A carefully crafted PDF file can trigger an infinite loop… openwall.com · mailing list
- [ofbiz-notifications] 20210613 [jira] [Updated] (OFBIZ-12256) Update PDFBox to 2.0.24 because of CVE-2021-31811 &… lists.apache.org · mailing list
- [ofbiz-notifications] 20210613 [jira] [Closed] (OFBIZ-12256) Update PDFBox to 2.0.24 because of CVE-2021-31811 &… lists.apache.org · mailing list
- [ofbiz-commits] 20210613 [ofbiz-framework] branch release17.12 updated: Fixed: Update PDFBox to 2.0.24 because of… lists.apache.org · mailing list
- [ofbiz-commits] 20210613 [ofbiz-framework] branch trunk updated: Fixed: Update PDFBox to 2.0.24 because of… lists.apache.org · mailing list
- [ofbiz-notifications] 20210613 [jira] [Created] (OFBIZ-12256) Update PDFBox to 2.0.24 because of CVE-2021-31811 &… lists.apache.org · mailing list
- [ofbiz-notifications] 20210613 [jira] [Commented] (OFBIZ-12256) Update PDFBox to 2.0.24 because of CVE-2021-31811 &… lists.apache.org · mailing list
- [ofbiz-commits] 20210613 [ofbiz-framework] branch release18.12 updated: Fixed: Update PDFBox to 2.0.24 because of… lists.apache.org · mailing list
- https://www.oracle.com/security-alerts/cpuoct2021.html oracle.com
- https://www.oracle.com/security-alerts/cpujan2022.html oracle.com
- https://www.oracle.com/security-alerts/cpuapr2022.html oracle.com
- https://www.oracle.com/security-alerts/cpujul2022.html oracle.com
Source: the record CVE-2021-31812 of the CVE List (CVE Program), CVE Terms of Use; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse