CVE-2018-8036: Pdfbox Loop With Unreachable Exit Condition Vulnerability
MODERATECVE-2018-8036 is a MODERATE (CVSS 6.5) loop with unreachable exit condition vulnerability (CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')) affecting Pdfbox libraries in the Maven ecosystem. The issue involves loop with unreachable exit condition in apache pdfbox. Remediation is available by upgrading affected packages to version 1.8.15, 2.0.11.
CVE-2018-8036 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H).
How to Fix CVE-2018-8036
To remediate this vulnerability, upgrade all affected Pdfbox 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.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>1.8.15</version>
</dependency>
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>2.0.11</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.pdfbox
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2018-8036, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=org.apache.pdfbox
Analyze the terminal output to locate any version of Pdfbox in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.8.15), your application is affected.
Note: The mvn dependency:tree -Dincludes=org.apache.pdfbox 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-835: Loop with Unreachable Exit Condition ('Infinite Loop'), where the product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop. In Pdfbox, 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-2018-8036 Affected Pdfbox Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.apache.pdfbox:pdfbox
|
Maven |
≥ 1.8.0
< 1.8.15
|
1.8.15
|
|
org.apache.pdfbox:pdfbox
|
Maven |
≥ 2.0.0RC1
< 2.0.11
|
2.0.11
|
References
Frequently Asked Questions
What is CVE-2018-8036?
Which Pdfbox versions are affected?
What version fixes CVE-2018-8036?
Is pdfbox affected?
What is the CVSS score of CVE-2018-8036?
What CWE is associated with CVE-2018-8036?
How can I check Maven dependencies for CVE-2018-8036?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-j2xq-pfff-mvgg",
"modified" : "2022-06-29T18:54:14Z",
"published" : "2022-05-13T01:53:29Z",
"aliases" : [ "CVE-2018-8036" ],
"summary" : "Loop with Unreachable Exit Condition in Apache PDFBox",
"details" : "In Apache PDFBox 1.8.0 to 1.8.14 and 2.0.0RC1 to 2.0.10, a carefully crafted (or fuzzed) file can trigger an infinite loop which leads to an out of memory exception in Apache PDFBox's AFMParser.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.pdfbox:pdfbox"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.8.0"
}, {
"fixed" : "1.8.15"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.8.14"
}
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.apache.pdfbox:pdfbox"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.0.0RC1"
}, {
"fixed" : "2.0.11"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 2.0.10"
}
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-8036"
}, {
"type" : "WEB",
"url" : "https://access.redhat.com/errata/RHSA-2018:2669"
}, {
"type" : "WEB",
"url" : "https://lists.apache.org/thread.html/9f62f742fd4fcd81654a9533b8a71349b064250840592bcd502dcfb6@%3Cusers.pdfbox.apache.org%3E"
}, {
"type" : "WEB",
"url" : "https://lists.apache.org/thread.html/r43491b25b2e5c368c34b106a82eff910a5cea3e90de82ad75cc16540@%3Cdev.syncope.apache.org%3E"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/6HKVPTJWZGUB4MH4AAOWMRJHRDBYFHGJ"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/POPOGHJ5CVMUVCRQU7APBAN5IVZGZFDX"
}, {
"type" : "WEB",
"url" : "https://www.oracle.com/security-alerts/cpuapr2020.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-835" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-06-29T18:54:14Z",
"nvd_published_at" : "2018-07-03T20:29:00Z"
}
}