Cloudanix VulnDB

CVE-2021-40648

Medium · 5.5

CVSS

5.5

EPSS

0.3%

Published

Sep 9, 2022

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A local flaw in a documentation conversion tool lets a malicious filename corrupt memory and crash the program, potentially interrupting documentation or build processes.

Exploit Available Chainable
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

  1. Identify or create a local context where man2html is invoked on a user-controlled filename
  2. Craft a filename that overwrites adjacent chunk metadata with attacker-chosen fd/bk/prev_size values
  3. Trigger man2html processing of the filename
  4. Force a subsequent free operation on the corrupted chunk
  5. 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