CVE-2021-40647
Medium · 5.5CVSS
5.5
EPSS
0.3%
Published
Sep 9, 2022
CISA due date
—
Cloudanix analysis
A local tool that converts manual pages can be fed a specially crafted file that makes the program crash or, on older systems, potentially lets an attacker run their own code.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Moderate
- Impact
- Denial Of Service
- Component
- Application
- Class
- Memory Corruption
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Heap-based memory corruption via oversized or malformed input that overwrites the top chunk size field, enabling a crash or arbitrary memory write on vulnerable GLIBC versions.
Why it matters to the business
Local users or automated processes handling untrusted man pages may experience denial of service; older systems face elevated risk of memory corruption that could be chained for code execution, though the issue is four years old with low exploit prevalence.
How an attack unfolds
An attacker supplies a crafted input file containing a specific string that triggers the size-parameter overwrite during parsing; on pre-2.29 GLIBC builds with proper alignment this yields an arbitrary write primitive that can be leveraged for further memory manipulation or control-flow hijacking.
How to fix it
Replace man2html with a maintained alternative or remove the package entirely; where continued use is required, compile against GLIBC 2.29+ and apply defensive heap protections such as full ASLR and glibc hardening options.
How to confirm the fix worked
Confirm removal of the man2html binary or verify that any retained version aborts cleanly on the known trigger string without producing a segmentation fault or memory corruption under glibc < 2.29.
Typical attack path
- Identify or create a malicious file that will be fed to man2html
- Trigger processing of the file via local execution or automated pipeline
- Trigger heap overwrite to cause crash or obtain write primitive
- Escalate to code execution or data corruption on vulnerable GLIBC
How to detect it
Search process execution logs, core dumps, and audit trails for repeated man2html invocations that terminate abnormally; examine any retained input files for strings that manipulate heap chunk metadata.
What your security team should do
- Inventory all systems that still ship or invoke man2html and schedule removal
- Block execution of man2html via allow-list or application control where feasible
- Monitor for man2html crashes in local process logs as an indicator of attempted exploitation
- Prefer modern alternatives such as mandoc or groff-based converters
The record
In man2html 1.6g, a specific string being read in from a file will overwrite the size parameter in the top chunk of the heap. This at least causes the program to segmentation abort if the heap size parameter isn't aligned correctly. In version before GLIBC version 2.29 and aligned correctly, it allows arbitrary write anywhere in the programs memory.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:11 | man2html | 0 | No fix |
| Debian:12 | man2html | 0 | No fix |
| Debian:13 | man2html | 0 | 1.6g-16 |
| Mageia:9 | man2html | 0 | 1.6-6.1.mga9 |
| 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-40648 In man2html 1.6g, a filename can be created to overwrite the previous size parameter of… Also affects man2html
- CVE-2026-111497 A buffer overflow vulnerability in the Brotli decoder (c/dec/decode.c) in Google Brotli… CWE-787
- CVE-2026-112397 Pillow is a Python imaging library. CWE-787
- CVE-2026-112059 libLAS through 1.8.1 contains a heap out-of-bounds write vulnerability in the point… CWE-787
- CVE-2026-89088 A flaw was found in parted. CWE-787
- CVE-2026-89085 A flaw was found in parted. CWE-787
- CVE-2026-85746 MariaDB server is a community developed fork of MySQL server. CWE-787
- CVE-2026-107815 MariaDB server is a community developed fork of MySQL server. CWE-787