CVE-2021-23158
A flaw was found in htmldoc in v1.9.12. Double-free in function pspdf_export(),in ps-pdf.cxx may...
A flaw was found in htmldoc in v1.9.12. Double-free in function pspdf_export(),in ps-pdf.cxx may result in a write-what-where condition, allowing an attacker to execute arbitrary code and denial of service.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
NVD Score used
9.8
A flaw was found in htmldoc in v1.9.12. Double-free in function pspdf_export(),in ps-pdf.cxx may result in a write-what-where condition, allowing an attacker to execute arbitrary code and denial of service.
- Record
CVE-2021-23158- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - CVSS 2.0
- 7.5 High
AV:N/AC:L/Au:N/C:P/I:P/A:P - Weakness
- CWE-415
- Updated
- 2026-11-02
CVE List No score
A flaw was found in htmldoc in v1.9.12. Double-free in function pspdf_export(),in ps-pdf.cxx may result in a write-what-where condition, allowing an attacker to execute arbitrary code and denial of service.
- Record
CVE-2021-23158- Weakness
- CWE-415
- Updated
- 2026-11-02
EUVDEUVD-2021-10270 No score
A flaw was found in htmldoc in v1.9.12. Double-free in function pspdf_export(),in ps-pdf.cxx may result in a write-what-where condition, allowing an attacker to execute arbitrary code and denial of service.
- Record
EUVD-2021-10270- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-hgcq-f5fx-5qp6
9.8
A flaw was found in htmldoc in v1.9.12. Double-free in function pspdf_export(),in ps-pdf.cxx may...
A flaw was found in htmldoc in v1.9.12. Double-free in function pspdf_export(),in ps-pdf.cxx may result in a write-what-where condition, allowing an attacker to execute arbitrary code and denial of service.
- Record
GHSA-hgcq-f5fx-5qp6- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-415
- Updated
- 2026-11-02
OSV
9.8
A flaw was found in htmldoc in v1.9.12. Double-free in function pspdf_export(),in ps-pdf.cxx may result in a write-what-where condition, allowing an attacker to execute arbitrary code and denial of service.
- Record
CVE-2021-23158- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVDEBIAN-CVE-2021-23158
9.8
A flaw was found in htmldoc in v1.9.12. Double-free in function pspdf_export(),in ps-pdf.cxx may result in a write-what-where condition, allowing an attacker to execute arbitrary code and denial of service.
- Record
DEBIAN-CVE-2021-23158- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVUBUNTU-CVE-2021-23158
9.8
A flaw was found in htmldoc in v1.9.12. Double-free in function pspdf_export(),in ps-pdf.cxx may result in a write-what-where condition, allowing an attacker to execute arbitrary code and denial of service.
- Record
UBUNTU-CVE-2021-23158- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVMGASA-2021-0332 No score
Updated htmldoc packages fix security vulnerabilities
Updated htmldoc packages fix security vulnerabilities:
Integer overflow in the htmldoc 1.9.11 and before may allow attackers to execute arbitrary code and cause a denial of service that is similar to CVE-2017-9181 (CVE-2021-20308).
AddressSanitizer: double-free in function pspdf_export ps-pdf.cxx (CVE-2021-23158).
AddressSanitizer: heap-buffer-overflow in pspdf_prepare_outpages() in ps-pdf.cxx (CVE-2021-23165).
AddressSanitizer: SEGV in file_extension file.c (CVE-2021-23180).
AddressSanitizer: SEGV on unknown address 0x000000000014 (CVE-2021-23191).
AddressSanitizer: stack-buffer-overflow in parse_table ps-pdf.cxx (CVE-2021-23206).
AddressSanitizer: heap-buffer-overflow in pspdf_prepare_page(int) ps-pdf.cxx (CVE-2021-26252).
AddressSanitizer: heap-buffer-overflow on render_table_row() ps-pdf.cxx (CVE-2021-26259).
SEGV on unknown address 0x000000000000 (CVE-2021-26948).
- Record
MGASA-2021-0332- Updated
- 2026-11-02
OSVUSN-7189-1 No score
HTMLDOC vulnerabilities
It was discovered that HTMLDOC incorrectly handled certain inputs, which could lead to an integer overflow. An attacker could potentially use this issue to cause a denial of service or execute arbitrary code. (CVE-2021-20308)
It was discovered that HTMLDOC incorrectly handled memory in pspdf_export, which could lead to a double-free. An attacker could potentially use this issue to cause a denial of service or execute arbitrary code. (CVE-2021-23158)
It was discovered that HTMLDOC incorrectly handled memory when loading a JPEG image, which could lead to a NULL pointer dereference. An attacker could potentially use this issue to cause a denial of service. (CVE-2021-23191, CVE-2021-26948)
It was discovered that HTMLDOC incorrectly handled certain inputs, which could lead to a stack buffer overflow. An attacker could potentially use this issue to cause a denial of service or execute arbitrary code. (CVE-2021-23206, CVE-2021-40985, CVE-2021-43579)
It was discovered that HTMLDOC incorrectly handled memory in pdpdf_prepare_page and render_table_row, which could lead to a heap buffer overflow. An attacker could potentially use this issue to cause a denial of service or execute arbitrary code. (CVE-2021-26252, CVE-2021-26259)
It was discovered that HTMLDOC incorrectly handled memory in parse_paragraph, which could lead to a heap buffer overflow. An attacker could potentially use this issue to cause a denial of service or execute arbitrary code. This issue only affected Ubuntu 20.04 LTS. (CVE-2021-34119)
It was discovered that HTMLDOC incorrectly handled memory in parse_tree. An attacker could potentially use this issue to leak sensitive information. (CVE-2021-34121)
- Record
USN-7189-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
htmldocDebian:12 |
before 1.9.11-4 | 1.9.11-4 |
htmldocDebian:13 |
before 1.9.11-4 | 1.9.11-4 |
htmldocDebian:14 |
before 1.9.11-4 | 1.9.11-4 |
htmldocDebian:9 From an advisory covering 10 CVEs |
before 1.8.27-8+deb9u1, plus listed versions 1.8.27-8 |
1.8.27-8+deb9u1 |
htmldocDebian:10 From an advisory covering 8 CVEs |
before 1.9.3-1+deb10u2, plus listed versions 1.9.3-11.9.3-1+deb10u1 |
1.9.3-1+deb10u2 |
htmldocMageia:7 From an advisory covering 9 CVEs |
before 1.9.3-2.3.mga7 | 1.9.3-2.3.mga7 |
htmldocMageia:8 From an advisory covering 9 CVEs |
before 1.9.8-1.2.mga8 | 1.9.8-1.2.mga8 |
htmldocUbuntu:Pro:14.04:LTS |
before 1.8.27-8ubuntu1+esm3, plus listed versions 1.8.27-8ubuntu11.8.27-8ubuntu1+esm11.8.27-8ubuntu1+esm2 |
1.8.27-8ubuntu1+esm3 |
htmldocUbuntu:Pro:16.04:LTS |
before 1.8.27-8ubuntu1.1+esm2, plus listed versions 1.8.27-8ubuntu11.8.27-8ubuntu1.11.8.27-8ubuntu1.1+esm1 |
1.8.27-8ubuntu1.1+esm2 |
htmldocUbuntu:Pro:18.04:LTS |
before 1.9.2-1ubuntu0.2+esm1, plus listed versions 1.8.27-8ubuntu21.8.27-8ubuntu31.9.2-11.9.2-1ubuntu0.11.9.2-1ubuntu0.2 |
1.9.2-1ubuntu0.2+esm1 |
Show 5 moreShow less
| Package | Affected | Fixed |
|---|---|---|
htmldocUbuntu:Pro:20.04:LTS |
before 1.9.7-1ubuntu0.3+esm1, plus listed versions 1.9.3-11.9.7-11.9.7-1build11.9.7-1ubuntu0.21.9.7-1ubuntu0.3 |
1.9.7-1ubuntu0.3+esm1 |
htmldocUbuntu:Pro:14.04:LTS From an advisory covering 11 CVEs |
before 1.8.27-8ubuntu1+esm3, plus listed versions 1.8.27-8ubuntu11.8.27-8ubuntu1+esm11.8.27-8ubuntu1+esm2 |
1.8.27-8ubuntu1+esm3 |
htmldocUbuntu:Pro:16.04:LTS From an advisory covering 11 CVEs |
before 1.8.27-8ubuntu1.1+esm2, plus listed versions 1.8.27-8ubuntu11.8.27-8ubuntu1.11.8.27-8ubuntu1.1+esm1 |
1.8.27-8ubuntu1.1+esm2 |
htmldocUbuntu:Pro:18.04:LTS From an advisory covering 11 CVEs |
before 1.9.2-1ubuntu0.2+esm1, plus listed versions 1.8.27-8ubuntu21.8.27-8ubuntu31.9.2-11.9.2-1ubuntu0.11.9.2-1ubuntu0.2 |
1.9.2-1ubuntu0.2+esm1 |
htmldocUbuntu:Pro:20.04:LTS From an advisory covering 11 CVEs |
before 1.9.7-1ubuntu0.3+esm1, plus listed versions 1.9.3-11.9.7-11.9.7-1build11.9.7-1ubuntu0.21.9.7-1ubuntu0.3 |
1.9.7-1ubuntu0.3+esm1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| aliases, products | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2021-23158 is a critical vulnerability (CVSS 9.8) in Htmldoc Project Htmldoc, published June 9, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 2.44%, the 84th percentile. Fixed in htmldoc 1.9.11-4.
References
github.com/michaelrsweet/htmldoc/issues/414
bugzilla.redhat.com/show_bug.cgi?id=1967018
github.com/michaelrsweet/htmldoc/commit/369b2ea1fd0d0537ba707f20a2f047b6afd2fbdc
nvd.nist.gov/vuln/detail/CVE-2021-23158
github.com/advisories/GHSA-hgcq-f5fx-5qp6
security-tracker.debian.org/tracker/CVE-2021-23158
Show 18 moreShow less
advisories.mageia.org/MGASA-2021-0332.html
bugs.mageia.org/show_bug.cgi?id=29161
bugs.mageia.org/show_bug.cgi?id=29101
debian.org/security/2021/dsa-4928
lists.opensuse.org/archives/list/[email protected]/thread/RXMQHLXPNKTCGM4HNTMLHF7NWL3ZXKIO
ubuntu.com/security/CVE-2021-23158
cve.org/CVERecord?id=CVE-2021-23158
ubuntu.com/security/notices/USN-7189-1
ubuntu.com/security/CVE-2021-20308
ubuntu.com/security/CVE-2021-23191
ubuntu.com/security/CVE-2021-23206
ubuntu.com/security/CVE-2021-26252
ubuntu.com/security/CVE-2021-26259
ubuntu.com/security/CVE-2021-26948
ubuntu.com/security/CVE-2021-34119
ubuntu.com/security/CVE-2021-34121
ubuntu.com/security/CVE-2021-40985
ubuntu.com/security/CVE-2021-43579