CVE-2021-40648
Medium · 5.5CVSS
5.5
EPSS
0.3%
Published
Sep 9, 2022
CISA due date
—
Cloudanix analysis
A local flaw in a documentation conversion tool lets a malicious filename corrupt memory and crash the program, potentially interrupting documentation or build processes.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Moderate
- Impact
- Denial Of Service
- Component
- Application
- Class
- Improper Input Validation
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
A crafted filename supplied to man2html allows an attacker to corrupt heap metadata (prev_size, fd, bk, fd_nextsize, bk_nextsize) of an adjacent chunk; subsequent free operations on that chunk release an arbitrary memory range, resulting in heap memory corruption.
Why it matters to the business
Local users or automated processes that invoke man2html on untrusted input can crash the converter or trigger memory-safety failures, disrupting documentation generation workflows and potentially halting dependent build or help-system pipelines.
How an attack unfolds
An attacker prepares a malicious filename whose bytes are interpreted as heap chunk metadata. When man2html processes the file, the corrupted metadata is written into the next chunk header. Later, when the allocator frees that chunk, an arbitrary memory region is released, leading to heap inconsistency that can be leveraged for denial of service or, with further manipulation, for code execution.
How to fix it
Upgrade to a patched version of man2html once released; until then, avoid processing untrusted filenames and run man2html inside a restricted environment or sandbox that limits heap impact.
How to confirm the fix worked
Confirm the installed man2html binary is newer than 1.6g or apply vendor-supplied patches; test by supplying known-malicious filenames in a controlled environment and verify that no heap-metadata corruption occurs and the process exits cleanly.
Typical attack path
- Identify or create a local context where man2html is invoked on a user-controlled filename
- Craft a filename that overwrites adjacent chunk metadata with attacker-chosen fd/bk/prev_size values
- Trigger man2html processing of the filename
- Force a subsequent free operation on the corrupted chunk
- Observe or exploit the resulting arbitrary-memory free for denial of service or further memory corruption
How to detect it
Review process execution logs and command-line arguments for invocations of man2html with unusually long or specially formatted filenames; inspect core dumps or heap-analysis tools for signs of corrupted chunk metadata following man2html runs.
What your security team should do
- Inventory all systems and build pipelines that invoke man2html and prioritize removal or replacement
- Block execution of man2html on untrusted input via application whitelisting or container isolation
- Monitor for future upstream fixes and schedule upgrade as soon as a fixed package is available
The record
In man2html 1.6g, a filename can be created to overwrite the previous size parameter of the next chunk and the fd, bk, fd_nextsize, bk_nextsize of the current chunk. The next chunk is then freed later on, causing a freeing of an arbitrary amount of memory.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:11 | man2html | 0 | No fix |
| Debian:12 | man2html | 0 | No fix |
| Debian:13 | man2html | 0 | No fix |
| Ubuntu:16.04:LTS | man2html | 0 | No fix |
| Ubuntu:18.04:LTS | man2html | 0 | No fix |
| Ubuntu:20.04:LTS | man2html | 0 | No fix |
| Ubuntu:22.04:LTS | man2html | 0 | No fix |
| Ubuntu:24.04:LTS | man2html | 0 | No fix |
| Ubuntu:24.10 | man2html | 0 | No fix |
| Ubuntu:25.04 | man2html | 0 | No fix |
| Ubuntu:25.10 | man2html | 0 | No fix |
| Ubuntu:Pro:16.04:LTS | man2html | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | man2html | 0 | No fix |
| Ubuntu:Pro:20.04:LTS | man2html | 0 | No fix |
Related vulnerabilities
- CVE-2021-40647 In man2html 1.6g, a specific string being read in from a file will overwrite the size… Also affects man2html
- CVE-2026-113786 pypdf is a free and open-source pure-python PDF library. CWE-20
- CVE-2026-112081 A vulnerability was determined in hankcs HanLP up to 2.1.0-beta.64. CWE-20
- CVE-2026-111869 A vulnerability was identified in makeplane plane up to 1.4.2. CWE-20
- CVE-2026-100347 kin-openapi is a Go project for handling OpenAPI files. CWE-20
- CVE-2026-99999 In the Linux kernel, the following vulnerability has been resolved: ipv4: validate… CWE-20
- CVE-2026-107726 Hazelcast is a unified real-time data platform combining stream processing with a fast… CWE-20
- CVE-2026-105757 vLLM is an inference and serving engine for large language models. CWE-20