CVE-2021-40985
Buffer overflow vulnerability in htmldoc before 1.9.12, allows attackers to cause a denial of...
A stack-based buffer under-read in htmldoc before 1.9.12, allows attackers to cause a denial of service via a crafted BMP image to image_load_bmp.
Attack profile
How easy it is to exploit
- Attack vector
- Local
- Complexity
- Low
- Privileges needed
- None
- User interaction
- Required
What an attacker can affect
- Confidentiality
- None
- Integrity
- None
- Availability
- High
Exploit likelihood
What each source reports
NVD Score used
5.5
A stack-based buffer under-read in htmldoc before 1.9.12, allows attackers to cause a denial of service via a crafted BMP image to image_load_bmp.
- Record
CVE-2021-40985- CVSS 3.1
- 5.5 Medium
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H - CVSS 2.0
- 4.3 Medium
AV:N/AC:M/Au:N/C:N/I:N/A:P - Weakness
- CWE-125
- Updated
- 2026-11-02
CVE List No score
A stack-based buffer under-read in htmldoc before 1.9.12, allows attackers to cause a denial of service via a crafted BMP image to image_load_bmp.
- Record
CVE-2021-40985- Updated
- 2026-11-02
EUVDEUVD-2021-28138 No score
A stack-based buffer under-read in htmldoc before 1.9.12, allows attackers to cause a denial of service via a crafted BMP image to image_load_bmp.
- Record
EUVD-2021-28138- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-vfx2-gpvv-rwcm
5.5
Buffer overflow vulnerability in htmldoc before 1.9.12, allows attackers to cause a denial of...
Buffer overflow vulnerability in htmldoc before 1.9.12, allows attackers to cause a denial of service via a crafted BMP image to image_load_bmp.
- Record
GHSA-vfx2-gpvv-rwcm- CVSS 3.1
- 5.5 Medium
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H - Weakness
- CWE-120, CWE-787
- Updated
- 2026-11-02
OSV
5.5
A stack-based buffer under-read in htmldoc before 1.9.12, allows attackers to cause a denial of service via a crafted BMP image to image_load_bmp.
- Record
CVE-2021-40985- CVSS 3.1
- 5.5 Medium
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
OSVDEBIAN-CVE-2021-40985
5.5
A stack-based buffer under-read in htmldoc before 1.9.12, allows attackers to cause a denial of service via a crafted BMP image to image_load_bmp.
- Record
DEBIAN-CVE-2021-40985- CVSS 3.1
- 5.5 Medium
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
Show 5 moreShow less
OSVUBUNTU-CVE-2021-40985
5.5
A stack-based buffer under-read in htmldoc before 1.9.12, allows attackers to cause a denial of service via a crafted BMP image to image_load_bmp.
- Record
UBUNTU-CVE-2021-40985- CVSS 3.1
- 5.5 Medium
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
OSVMGASA-2022-0014 No score
Updated htmldoc packages fix security vulnerability
Buffer overflow vulnerability in htmldoc before 1.9.12, allows attackers to cause a denial of service via a crafted BMP image to image_load_bmp. (CVE-2021-40985)
- Record
MGASA-2022-0014- Updated
- 2026-11-02
OSVopenSUSE-SU-2024:11611-1 No score
htmldoc-1.9.12-2.1 on GA media
These are all security issues fixed in the htmldoc-1.9.12-2.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2024:11611-1- Updated
- 2026-11-02
OSVSUSE-SU-2021:14869-1 No score
Security update for htmldoc
This update for htmldoc fixes the following issues:
- CVE-2021-40985: Fixed a buffer overflow that may have let to a DoS via a crafted BMP image (bsc#1192357).
- Record
SUSE-SU-2021:14869-1- 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.13-1 | 1.9.13-1 |
htmldocDebian:13 |
before 1.9.13-1 | 1.9.13-1 |
htmldocDebian:14 |
before 1.9.13-1 | 1.9.13-1 |
htmldocDebian:9 From an advisory covering 3 CVEs |
before 1.8.27-8+deb9u2, plus listed versions 1.8.27-81.8.27-8+deb9u1 |
1.8.27-8+deb9u2 |
htmldocMageia:8 |
before 1.9.8-1.3.mga8 | 1.9.8-1.3.mga8 |
htmldocSUSE:Subscription Management Tool 11 SP3 |
before 1.8.27-170.4.3.1 | 1.8.27-170.4.3.1 |
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 |
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 |
Show 5 moreShow less
| Package | Affected | Fixed |
|---|---|---|
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 |
htmldocopenSUSE:Tumbleweed |
before 1.9.12-2.1 | 1.9.12-2.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| aliases | 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-40985 is a medium vulnerability (CVSS 5.5) in Htmldoc Project Htmldoc, published November 3, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.94%, the 61st percentile. Fixed in htmldoc 1.9.13-1.
References
github.com/michaelrsweet/htmldoc/commit/f12b9666e582a8e7b70f11b28e5ffc49ad625d43
github.com/michaelrsweet/htmldoc/issues/444
lists.debian.org/debian-lts-announce/2022/02/msg00022.html
nvd.nist.gov/vuln/detail/CVE-2021-40985
github.com/advisories/GHSA-vfx2-gpvv-rwcm
security-tracker.debian.org/tracker/CVE-2021-40985
Show 19 moreShow less
advisories.mageia.org/MGASA-2022-0014.html
bugs.mageia.org/show_bug.cgi?id=29806
lists.suse.com/pipermail/sle-security-updates/2021-December/009935.html
suse.com/support/update/announcement/2021/suse-su-202114869-1
bugzilla.suse.com/1192357
suse.com/security/cve/CVE-2021-40985
ubuntu.com/security/CVE-2021-40985
cve.org/CVERecord?id=CVE-2021-40985
ubuntu.com/security/notices/USN-7189-1
ubuntu.com/security/CVE-2021-20308
ubuntu.com/security/CVE-2021-23158
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-43579