libxml2, lxml — security advisory
NULL Pointer Dereference allows attackers to cause a denial of service (or application crash). This only applies when lxml is used together with libxml2 2.9.10 through 2.9.14. libxml2 2.9.9 and earlier are not affected. It allows triggering crashes through forged input data, given a vulnerable code sequence in the application. The vulnerability is caused by the iterwalk function (also used by the canonicalize function). Such code shouldn't be in wide-spread use, given that parsing + iterwalk would usually be replaced with the more efficient iterparse function. However, an XML converter that serialises to C14N would also be vulnerable, for example, and there are legitimate use cases for this code sequence. If untrusted input is received (also remotely) and processed via iterwalk function, a crash can be triggered.
- Products
- libxml2, lxml
- Affected versions
- 2.9.10+dfsg-1ubuntu3, 2.9.10+dfsg-4build1, 2.9.10+dfsg-5, 2.9.10+dfsg-5ubuntu0.20.04.1, 2.9.10+dfsg-5ubuntu0.20.04.2, 2.9.10+dfsg-5ubuntu0.20.04.3, 2.9.10+dfsg-5ubuntu0.20.04.4, 2.9.12+dfsg-4, 2.9.12+dfsg-5, 2.9.12+dfsg-6, 2.9.13+dfsg-1, 2.9.13+dfsg-1build1, 2.9.13+dfsg-1ubuntu0.1, 2.9.4+dfsg1-7ubuntu3, 2.9.4+dfsg1-7ubuntu5, 2.9.4+dfsg1-8ubuntu1, 2.9.4+dfsg1-8ubuntu2, 2.9.4+dfsg1-8ubuntu3, 3.2.0-1, 3.3.0~beta2-1, 3.3.0~beta4-1, 3.3.1-1, 3.3.2-1, 3.3.2-1build1, 3.3.3-1, 3.3.3-1ubuntu0.1, 3.3.3-1ubuntu0.2, 3.3.3-1ubuntu0.2+esm1, 3.3.3-1ubuntu0.2+esm2, 3.3.3-1ubuntu0.2+esm3, 3.3.3-1ubuntu0.2+esm5, 3.3.3-1ubuntu0.2+esm6, 3.4.4-1, 3.5.0-1, 3.5.0-1build1, 3.5.0-1ubuntu0.1, 3.5.0-1ubuntu0.2, 3.5.0-1ubuntu0.3, 3.5.0-1ubuntu0.4, 3.5.0-1ubuntu0.4+esm2, 3.5.0-1ubuntu0.4+esm3, 4.0.0-1, 4.1.0-1, 4.2.0-1, 4.2.1-1, 4.2.1-1ubuntu0.1, 4.2.1-1ubuntu0.2, 4.2.1-1ubuntu0.3, 4.2.1-1ubuntu0.4, 4.2.1-1ubuntu0.6, 4.2.1-1ubuntu0.6+esm1, 4.4.1-1, 4.4.1-1build1, 4.4.2-1, 4.5.0-1, 4.5.0-1ubuntu0.1, 4.5.0-1ubuntu0.2, 4.5.0-1ubuntu0.3, 4.5.0-1ubuntu0.5, 4.5.0-1ubuntu0.5+esm1, 4.6.3+dfsg-0.1, 4.6.4-1, 4.6.4-1ubuntu1, 4.7.1-1, 4.8.0-1, 4.8.0-1build1, 4.8.0-1ubuntu0.1
- Fixed versions
- 2.9.10+dfsg-5ubuntu0.20.04.5, 2.9.13+dfsg-1ubuntu0.2
- CVEs
- CVE-2022-2309
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 28 Oct 2026, 09:08 UTC · Revision 1
Source evidence
NULL Pointer Dereference allows attackers to cause a denial of service (or application crash). This only applies when lxml is used together with libxml2 2.9.10 through 2.9.14. libxml2 2.9.9 and earlier are not affected. It allows triggering crashes through forged input data, given a vulnerable code sequence in the application. The vulnerability is caused by the iterwalk function (also used by the canonicalize function). Such code shouldn't be in wide-spread use, given that parsing + iterwalk would usually be replaced with the more efficient iterparse function. However, an XML converter that serialises to C14N would also be vulnerable, for example, and there are legitimate use cases for this code sequence. If untrusted input is received (also remotely) and processed via iterwalk function, a crash can be triggered.
osv:UBUNTU-CVE-2022-2309
lxml
Fixed versions: Not specified
lxml
Fixed versions: Not specified
lxml
Fixed versions: Not specified
libxml2
Fixed versions: 2.9.10+dfsg-5ubuntu0.20.04.5
lxml
Fixed versions: Not specified
libxml2
Fixed versions: 2.9.13+dfsg-1ubuntu0.2
lxml
Fixed versions: Not specified
Complete source record
{
"id": "e863678f4d398476208402287e2704aead6992e63ca347f897f610d0823b4b85",
"url": "https://osv.dev/vulnerability/UBUNTU-CVE-2022-2309",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "UBUNTU-CVE-2022-2309",
"summary": "NULL Pointer Dereference allows attackers to cause a denial of service (or application crash). This only applies when lxml is used together with libxml2 2.9.10 through 2.9.14. libxml2 2.9.9 and earlier are not affected. It allows triggering crashes through forged input data, given a vulnerable code sequence in the application. The vulnerability is caused by the iterwalk function (also used by the canonicalize function). Such code shouldn't be in wide-spread use, given that parsing + iterwalk would usually be replaced with the more efficient iterparse function. However, an XML converter that serialises to C14N would also be vulnerable, for example, and there are legitimate use cases for this code sequence. If untrusted input is received (also remotely) and processed via iterwalk function, a crash can be triggered.",
"evidence": "osv:UBUNTU-CVE-2022-2309",
"products": [
{
"name": {
"value": "lxml",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "3.2.0-1",
"evidence": "/affected/0/versions"
},
{
"value": "3.3.0~beta2-1",
"evidence": "/affected/0/versions"
},
{
"value": "3.3.0~beta4-1",
"evidence": "/affected/0/versions"
},
{
"value": "3.3.1-1",
"evidence": "/affected/0/versions"
},
{
"value": "3.3.2-1",
"evidence": "/affected/0/versions"
},
{
"value": "3.3.2-1build1",
"evidence": "/affected/0/versions"
},
{
"value": "3.3.3-1",
"evidence": "/affected/0/versions"
},
{
"value": "3.3.3-1ubuntu0.1",
"evidence": "/affected/0/versions"
},
{
"value": "3.3.3-1ubuntu0.2",
"evidence": "/affected/0/versions"
},
{
"value": "3.3.3-1ubuntu0.2+esm1",
"evidence": "/affected/0/versions"
},
{
"value": "3.3.3-1ubuntu0.2+esm2",
"evidence": "/affected/0/versions"
},
{
"value": "3.3.3-1ubuntu0.2+esm3",
"evidence": "/affected/0/versions"
},
{
"value": "3.3.3-1ubuntu0.2+esm5",
"evidence": "/affected/0/versions"
},
{
"value": "3.3.3-1ubuntu0.2+esm6",
"evidence": "/affected/0/versions"
}
]
},
{
"name": {
"value": "lxml",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "3.4.4-1",
"evidence": "/affected/1/versions"
},
{
"value": "3.5.0-1",
"evidence": "/affected/1/versions"
},
{
"value": "3.5.0-1build1",
"evidence": "/affected/1/versions"
},
{
"value": "3.5.0-1ubuntu0.1",
"evidence": "/affected/1/versions"
},
{
"value": "3.5.0-1ubuntu0.2",
"evidence": "/affected/1/versions"
},
{
"value": "3.5.0-1ubuntu0.3",
"evidence": "/affected/1/versions"
},
{
"value": "3.5.0-1ubuntu0.4",
"evidence": "/affected/1/versions"
},
{
"value": "3.5.0-1ubuntu0.4+esm2",
"evidence": "/affected/1/versions"
},
{
"value": "3.5.0-1ubuntu0.4+esm3",
"evidence": "/affected/1/versions"
}
]
},
{
"name": {
"value": "lxml",
"evidence": "/affected/2/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "4.0.0-1",
"evidence": "/affected/2/versions"
},
{
"value": "4.1.0-1",
"evidence": "/affected/2/versions"
},
{
"value": "4.2.0-1",
"evidence": "/affected/2/versions"
},
{
"value": "4.2.1-1",
"evidence": "/affected/2/versions"
},
{
"value": "4.2.1-1ubuntu0.1",
"evidence": "/affected/2/versions"
},
{
"value": "4.2.1-1ubuntu0.2",
"evidence": "/affected/2/versions"
},
{
"value": "4.2.1-1ubuntu0.3",
"evidence": "/affected/2/versions"
},
{
"value": "4.2.1-1ubuntu0.4",
"evidence": "/affected/2/versions"
},
{
"value": "4.2.1-1ubuntu0.6",
"evidence": "/affected/2/versions"
},
{
"value": "4.2.1-1ubuntu0.6+esm1",
"evidence": "/affected/2/versions"
}
]
},
{
"name": {
"value": "libxml2",
"evidence": "/affected/3/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "2.9.10+dfsg-5ubuntu0.20.04.5",
"evidence": "/affected/3/ranges"
}
],
"affected_versions": [
{
"value": "2.9.4+dfsg1-7ubuntu3",
"evidence": "/affected/3/versions"
},
{
"value": "2.9.4+dfsg1-7ubuntu5",
"evidence": "/affected/3/versions"
},
{
"value": "2.9.4+dfsg1-8ubuntu1",
"evidence": "/affected/3/versions"
},
{
"value": "2.9.4+dfsg1-8ubuntu2",
"evidence": "/affected/3/versions"
},
{
"value": "2.9.4+dfsg1-8ubuntu3",
"evidence": "/affected/3/versions"
},
{
"value": "2.9.10+dfsg-1ubuntu3",
"evidence": "/affected/3/versions"
},
{
"value": "2.9.10+dfsg-4build1",
"evidence": "/affected/3/versions"
},
{
"value": "2.9.10+dfsg-5",
"evidence": "/affected/3/versions"
},
{
"value": "2.9.10+dfsg-5ubuntu0.20.04.1",
"evidence": "/affected/3/versions"
},
{
"value": "2.9.10+dfsg-5ubuntu0.20.04.2",
"evidence": "/affected/3/versions"
},
{
"value": "2.9.10+dfsg-5ubuntu0.20.04.3",
"evidence": "/affected/3/versions"
},
{
"value": "2.9.10+dfsg-5ubuntu0.20.04.4",
"evidence": "/affected/3/versions"
}
]
},
{
"name": {
"value": "lxml",
"evidence": "/affected/4/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "4.4.1-1",
"evidence": "/affected/4/versions"
},
{
"value": "4.4.1-1build1",
"evidence": "/affected/4/versions"
},
{
"value": "4.4.2-1",
"evidence": "/affected/4/versions"
},
{
"value": "4.5.0-1",
"evidence": "/affected/4/versions"
},
{
"value": "4.5.0-1ubuntu0.1",
"evidence": "/affected/4/versions"
},
{
"value": "4.5.0-1ubuntu0.2",
"evidence": "/affected/4/versions"
},
{
"value": "4.5.0-1ubuntu0.3",
"evidence": "/affected/4/versions"
},
{
"value": "4.5.0-1ubuntu0.5",
"evidence": "/affected/4/versions"
},
{
"value": "4.5.0-1ubuntu0.5+esm1",
"evidence": "/affected/4/versions"
}
]
},
{
"name": {
"value": "libxml2",
"evidence": "/affected/5/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "2.9.13+dfsg-1ubuntu0.2",
"evidence": "/affected/5/ranges"
}
],
"affected_versions": [
{
"value": "2.9.12+dfsg-4",
"evidence": "/affected/5/versions"
},
{
"value": "2.9.12+dfsg-5",
"evidence": "/affected/5/versions"
},
{
"value": "2.9.12+dfsg-6",
"evidence": "/affected/5/versions"
},
{
"value": "2.9.13+dfsg-1",
"evidence": "/affected/5/versions"
},
{
"value": "2.9.13+dfsg-1build1",
"evidence": "/affected/5/versions"
},
{
"value": "2.9.13+dfsg-1ubuntu0.1",
"evidence": "/affected/5/versions"
}
]
},
{
"name": {
"value": "lxml",
"evidence": "/affected/6/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "4.6.3+dfsg-0.1",
"evidence": "/affected/6/versions"
},
{
"value": "4.6.4-1",
"evidence": "/affected/6/versions"
},
{
"value": "4.6.4-1ubuntu1",
"evidence": "/affected/6/versions"
},
{
"value": "4.7.1-1",
"evidence": "/affected/6/versions"
},
{
"value": "4.8.0-1",
"evidence": "/affected/6/versions"
},
{
"value": "4.8.0-1build1",
"evidence": "/affected/6/versions"
},
{
"value": "4.8.0-1ubuntu0.1",
"evidence": "/affected/6/versions"
}
]
}
],
"severity": "high",
"structured": {
"id": "UBUNTU-CVE-2022-2309",
"aliases": [
"UBUNTU-CVE-2022-2309"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
},
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
},
{
"type": "Ubuntu",
"score": "low"
}
],
"affected": [
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "lxml",
"purl": "pkg:deb/ubuntu/lxml?arch=source&distro=esm-infra-legacy%2Ftrusty",
"ecosystem": "Ubuntu:Pro:14.04:LTS"
},
"versions": [
"3.2.0-1",
"3.3.0~beta2-1",
"3.3.0~beta4-1",
"3.3.1-1",
"3.3.2-1",
"3.3.2-1build1",
"3.3.3-1",
"3.3.3-1ubuntu0.1",
"3.3.3-1ubuntu0.2",
"3.3.3-1ubuntu0.2+esm1",
"3.3.3-1ubuntu0.2+esm2",
"3.3.3-1ubuntu0.2+esm3",
"3.3.3-1ubuntu0.2+esm5",
"3.3.3-1ubuntu0.2+esm6"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2022/UBUNTU-CVE-2022-2309.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "python-lxml",
"binary_version": "3.3.3-1ubuntu0.2+esm6"
},
{
"binary_name": "python3-lxml",
"binary_version": "3.3.3-1ubuntu0.2+esm6"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "lxml",
"purl": "pkg:deb/ubuntu/lxml?arch=source&distro=esm-infra-legacy%2Fxenial",
"ecosystem": "Ubuntu:Pro:16.04:LTS"
},
"versions": [
"3.4.4-1",
"3.5.0-1",
"3.5.0-1build1",
"3.5.0-1ubuntu0.1",
"3.5.0-1ubuntu0.2",
"3.5.0-1ubuntu0.3",
"3.5.0-1ubuntu0.4",
"3.5.0-1ubuntu0.4+esm2",
"3.5.0-1ubuntu0.4+esm3"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2022/UBUNTU-CVE-2022-2309.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "python-lxml",
"binary_version": "3.5.0-1ubuntu0.4+esm3"
},
{
"binary_name": "python3-lxml",
"binary_version": "3.5.0-1ubuntu0.4+esm3"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "lxml",
"purl": "pkg:deb/ubuntu/lxml?arch=source&distro=esm-infra%2Fbionic",
"ecosystem": "Ubuntu:Pro:18.04:LTS"
},
"versions": [
"4.0.0-1",
"4.1.0-1",
"4.2.0-1",
"4.2.1-1",
"4.2.1-1ubuntu0.1",
"4.2.1-1ubuntu0.2",
"4.2.1-1ubuntu0.3",
"4.2.1-1ubuntu0.4",
"4.2.1-1ubuntu0.6",
"4.2.1-1ubuntu0.6+esm1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2022/UBUNTU-CVE-2022-2309.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "python-lxml",
"binary_version": "4.2.1-1ubuntu0.6+esm1"
},
{
"binary_name": "python3-lxml",
"binary_version": "4.2.1-1ubuntu0.6+esm1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "2.9.10+dfsg-5ubuntu0.20.04.5"
}
]
}
],
"package": {
"name": "libxml2",
"purl": "pkg:deb/ubuntu/libxml2?arch=source&distro=focal",
"ecosystem": "Ubuntu:20.04:LTS"
},
"versions": [
"2.9.4+dfsg1-7ubuntu3",
"2.9.4+dfsg1-7ubuntu5",
"2.9.4+dfsg1-8ubuntu1",
"2.9.4+dfsg1-8ubuntu2",
"2.9.4+dfsg1-8ubuntu3",
"2.9.10+dfsg-1ubuntu3",
"2.9.10+dfsg-4build1",
"2.9.10+dfsg-5",
"2.9.10+dfsg-5ubuntu0.20.04.1",
"2.9.10+dfsg-5ubuntu0.20.04.2",
"2.9.10+dfsg-5ubuntu0.20.04.3",
"2.9.10+dfsg-5ubuntu0.20.04.4"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2022/UBUNTU-CVE-2022-2309.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "libxml2",
"binary_version": "2.9.10+dfsg-5ubuntu0.20.04.5"
},
{
"binary_name": "libxml2-utils",
"binary_version": "2.9.10+dfsg-5ubuntu0.20.04.5"
},
{
"binary_name": "python-libxml2",
"binary_version": "2.9.10+dfsg-5ubuntu0.20.04.5"
},
{
"binary_name": "python3-libxml2",
"binary_version": "2.9.10+dfsg-5ubuntu0.20.04.5"
}
],
"availability": "No subscription required"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "lxml",
"purl": "pkg:deb/ubuntu/lxml?arch=source&distro=esm-infra%2Ffocal",
"ecosystem": "Ubuntu:Pro:20.04:LTS"
},
"versions": [
"4.4.1-1",
"4.4.1-1build1",
"4.4.2-1",
"4.5.0-1",
"4.5.0-1ubuntu0.1",
"4.5.0-1ubuntu0.2",
"4.5.0-1ubuntu0.3",
"4.5.0-1ubuntu0.5",
"4.5.0-1ubuntu0.5+esm1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2022/UBUNTU-CVE-2022-2309.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "python-lxml",
"binary_version": "4.5.0-1ubuntu0.5+esm1"
},
{
"binary_name": "python3-lxml",
"binary_version": "4.5.0-1ubuntu0.5+esm1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
},
{
"fixed": "2.9.13+dfsg-1ubuntu0.2"
}
]
}
],
"package": {
"name": "libxml2",
"purl": "pkg:deb/ubuntu/libxml2?arch=source&distro=jammy",
"ecosystem": "Ubuntu:22.04:LTS"
},
"versions": [
"2.9.12+dfsg-4",
"2.9.12+dfsg-5",
"2.9.12+dfsg-6",
"2.9.13+dfsg-1",
"2.9.13+dfsg-1build1",
"2.9.13+dfsg-1ubuntu0.1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2022/UBUNTU-CVE-2022-2309.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "libxml2",
"binary_version": "2.9.13+dfsg-1ubuntu0.2"
},
{
"binary_name": "libxml2-utils",
"binary_version": "2.9.13+dfsg-1ubuntu0.2"
},
{
"binary_name": "python3-libxml2",
"binary_version": "2.9.13+dfsg-1ubuntu0.2"
}
],
"availability": "No subscription required"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "lxml",
"purl": "pkg:deb/ubuntu/lxml?arch=source&distro=jammy",
"ecosystem": "Ubuntu:22.04:LTS"
},
"versions": [
"4.6.3+dfsg-0.1",
"4.6.4-1",
"4.6.4-1ubuntu1",
"4.7.1-1",
"4.8.0-1",
"4.8.0-1build1",
"4.8.0-1ubuntu0.1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2022/UBUNTU-CVE-2022-2309.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "python3-lxml",
"binary_version": "4.8.0-1ubuntu0.1"
}
]
}
}
],
"modified": "2026-10-08T12:50:14.335895552Z",
"provider": "osv",
"upstream": [
"CVE-2022-2309"
],
"references": [
"https://ubuntu.com/security/CVE-2022-2309",
"https://huntr.dev/bounties/8264e74f-edda-4c40-9956-49de635105ba/",
"https://github.com/lxml/lxml/commit/86368e9cf70a0ad23cccd5ee32de847149af0c6f",
"https://huntr.dev/bounties/8264e74f-edda-4c40-9956-49de635105ba",
"https://gitlab.gnome.org/GNOME/libxml2/-/issues/378",
"https://ubuntu.com/security/notices/USN-5760-1",
"https://ubuntu.com/security/notices/USN-6028-2",
"https://www.cve.org/CVERecord?id=CVE-2022-2309"
]
},
"related_cves": [
{
"value": "CVE-2022-2309",
"evidence": "/upstream"
}
],
"security_relevant": true,
"severity_evidence": "/severity/1/score"
},
"source_id": "core-osv",
"document_id": 99526,
"published_at": "2022-07-05T10:15:00+00:00"
}