pypdf — security advisory
pypdf is an open source, pure-python PDF library. In affected versions an attacker may craft a PDF which leads to an infinite loop if `__parse_content_stream` is executed. That is, for example, the case if the user extracted text from such a PDF. This issue was introduced in pull request #969 and resolved in pull request #1828. Users are advised to upgrade. Users unable to upgrade may modify the line `while peek not in (b"\r", b"\n")` in `pypdf/generic/_data_structures.py` to `while peek not in (b"\r", b"\n", b"")`.
- Products
- pypdf
- Affected versions
- 3.17.4-1, 3.4.1-1, 4.0.0-1, 4.0.1-1, 4.0.2-1, 4.3.1-1, 5.4.0-1, 6.9.2-1, 6.9.2-2
- Fixed versions
- Not specified
- CVEs
- CVE-2023-36464
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 31 Oct 2026, 01:03 UTC · Revision 1
Source evidence
pypdf is an open source, pure-python PDF library. In affected versions an attacker may craft a PDF which leads to an infinite loop if `__parse_content_stream` is executed. That is, for example, the case if the user extracted text from such a PDF. This issue was introduced in pull request #969 and resolved in pull request #1828. Users are advised to upgrade. Users unable to upgrade may modify the line `while peek not in (b"\r", b"\n")` in `pypdf/generic/_data_structures.py` to `while peek not in (b"\r", b"\n", b"")`.
osv:UBUNTU-CVE-2023-36464
pypdf
Fixed versions: Not specified
pypdf
Fixed versions: Not specified
pypdf
Fixed versions: Not specified
pypdf
Fixed versions: Not specified
Complete source record
{
"id": "e20cf5c92d2668d9f4f2a220d5438e68b2a92bac224887943fd5b4a79fb7c782",
"url": "https://osv.dev/vulnerability/UBUNTU-CVE-2023-36464",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "UBUNTU-CVE-2023-36464",
"summary": "pypdf is an open source, pure-python PDF library. In affected versions an attacker may craft a PDF which leads to an infinite loop if `__parse_content_stream` is executed. That is, for example, the case if the user extracted text from such a PDF. This issue was introduced in pull request #969 and resolved in pull request #1828. Users are advised to upgrade. Users unable to upgrade may modify the line `while peek not in (b\"\\r\", b\"\\n\")` in `pypdf/generic/_data_structures.py` to `while peek not in (b\"\\r\", b\"\\n\", b\"\")`.",
"evidence": "osv:UBUNTU-CVE-2023-36464",
"products": [
{
"name": {
"value": "pypdf",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "3.4.1-1",
"evidence": "/affected/0/versions"
},
{
"value": "3.17.4-1",
"evidence": "/affected/0/versions"
},
{
"value": "4.0.0-1",
"evidence": "/affected/0/versions"
},
{
"value": "4.0.1-1",
"evidence": "/affected/0/versions"
},
{
"value": "4.0.2-1",
"evidence": "/affected/0/versions"
}
]
},
{
"name": {
"value": "pypdf",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "4.3.1-1",
"evidence": "/affected/1/versions"
},
{
"value": "5.4.0-1",
"evidence": "/affected/1/versions"
}
]
},
{
"name": {
"value": "pypdf",
"evidence": "/affected/2/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "6.9.2-1",
"evidence": "/affected/2/versions"
},
{
"value": "6.9.2-2",
"evidence": "/affected/2/versions"
}
]
},
{
"name": {
"value": "pypdf",
"evidence": "/affected/3/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "5.4.0-1",
"evidence": "/affected/3/versions"
},
{
"value": "6.9.2-1",
"evidence": "/affected/3/versions"
}
]
}
],
"severity": "medium",
"structured": {
"id": "UBUNTU-CVE-2023-36464",
"aliases": [
"UBUNTU-CVE-2023-36464"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
},
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"
},
{
"type": "Ubuntu",
"score": "medium"
}
],
"affected": [
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "pypdf",
"purl": "pkg:deb/ubuntu/pypdf?arch=source&distro=noble",
"ecosystem": "Ubuntu:24.04:LTS"
},
"versions": [
"3.4.1-1",
"3.17.4-1",
"4.0.0-1",
"4.0.1-1",
"4.0.2-1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2023/UBUNTU-CVE-2023-36464.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "python3-pypdf",
"binary_version": "4.0.2-1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "pypdf",
"purl": "pkg:deb/ubuntu/pypdf?arch=source&distro=questing",
"ecosystem": "Ubuntu:25.10"
},
"versions": [
"4.3.1-1",
"5.4.0-1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2023/UBUNTU-CVE-2023-36464.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "python3-pypdf",
"binary_version": "5.4.0-1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "pypdf",
"purl": "pkg:deb/ubuntu/pypdf?arch=source&distro=stonking",
"ecosystem": "Ubuntu:26.10"
},
"versions": [
"6.9.2-1",
"6.9.2-2"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2023/UBUNTU-CVE-2023-36464.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "python3-pypdf",
"binary_version": "6.9.2-2"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "pypdf",
"purl": "pkg:deb/ubuntu/pypdf?arch=source&distro=resolute",
"ecosystem": "Ubuntu:26.04:LTS"
},
"versions": [
"5.4.0-1",
"6.9.2-1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2023/UBUNTU-CVE-2023-36464.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "python3-pypdf",
"binary_version": "6.9.2-1"
}
]
}
}
],
"modified": "2026-10-17T12:56:24.122706920Z",
"provider": "osv",
"upstream": [
"CVE-2023-36464"
],
"references": [
"https://ubuntu.com/security/CVE-2023-36464",
"https://github.com/py-pdf/pypdf/pull/969",
"https://github.com/py-pdf/pypdf/pull/1828",
"https://github.com/py-pdf/pypdf/security/advisories/GHSA-4vvm-4w3v-6mr8",
"https://www.cve.org/CVERecord?id=CVE-2023-36464"
]
},
"related_cves": [
{
"value": "CVE-2023-36464",
"evidence": "/upstream"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 355558,
"published_at": "2023-06-27T22:15:00+00:00"
}