CVE-2023-36810: PyPDF2 PyPDF2 Quadratic Runtime With Malformed Vulnerability
MODERATECVE-2023-36810 is a MODERATE (CVSS 6.2) pypdf2 quadratic runtime with malformed vulnerability (CWE-407: Inefficient Algorithmic Complexity) affecting PyPDF2 libraries in the PyPI ecosystem. The issue involves pypdf2 quadratic runtime with malformed pdf missing xref marker. Remediation is available by upgrading affected packages to version 1.27.9.
CVE-2023-36810 at a Glance
Security Impact
CVSS: 6.2
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:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2023-36810
To remediate this vulnerability, upgrade all affected PyPDF2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install PyPDF2>=1.27.9
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show PyPDF2
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2023-36810, inspect your installed packages using pip:
pip show PyPDF2
Analyze the terminal output to locate any version of PyPDF2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.27.9), your application is affected.
Note: The pip show PyPDF2 command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-407: Inefficient Algorithmic Complexity, where an algorithm in a product has an inefficient worst-case computational complexity that may be detrimental to system performance and can be triggered by an attacker, typically using crafted manipulations that ensure that the worst case is being reached. In PyPDF2, 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-2023-36810 Affected PyPDF2 Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
PyPDF2
|
PyPI |
< 1.27.9
|
1.27.9
|
References
Frequently Asked Questions
What is CVE-2023-36810?
Which PyPDF2 versions are affected?
What version fixes CVE-2023-36810?
Is PyPDF2 affected?
What is the CVSS score of CVE-2023-36810?
What CWE is associated with CVE-2023-36810?
How can I check PyPI dependencies for CVE-2023-36810?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-jrm6-h9cq-8gqw",
"modified" : "2023-06-30T22:17:52Z",
"published" : "2023-06-30T22:17:52Z",
"aliases" : [ "CVE-2023-36810" ],
"summary" : "PyPDF2 quadratic runtime with malformed PDF missing xref marker",
"details" : "### Impact\nAn attacker who uses this vulnerability can craft a PDF which leads to unexpected long runtime.\nThis quadratic runtime blocks the current process and can utilize a single core of the CPU by 100%. It does not affect memory usage.\n\n### Patches\nhttps://github.com/py-pdf/pypdf/pull/808\n\n### Workarounds\n_Is there a way for users to fix or remediate the vulnerability without upgrading?_\n\n### References\n* [PyPDF2 PR #808](https://github.com/py-pdf/pypdf/pull/808)\n* [PyPDF2 Issue #582](https://github.com/py-pdf/pypdf/issues/582)",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "PyPDF2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.27.9"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.27.8"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/py-pdf/pypdf/security/advisories/GHSA-jrm6-h9cq-8gqw"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-36810"
}, {
"type" : "WEB",
"url" : "https://github.com/py-pdf/pypdf/issues/582"
}, {
"type" : "WEB",
"url" : "https://github.com/py-pdf/pypdf/pull/808"
}, {
"type" : "WEB",
"url" : "https://github.com/py-pdf/pypdf/commit/c6c56f550bb384e05f0139c796ba1308837d6373"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/py-pdf/pypdf"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2023/07/msg00019.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-407" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-06-30T22:17:52Z",
"nvd_published_at" : "2023-06-30T19:15:09Z"
}
}