rui314 mold Heap-Based Buffer Overflow Vulnerability in Object File Handler

Vulnerability

A heap-based buffer overflow vulnerability has been identified in rui314 mold versions through 2.40.4. The issue arises in the Object File Handler component, specifically within the function 'mold::ObjectFile<mold::X86_64>::initialize_sections' in 'src/input-files.cc'. This vulnerability requires local exploitation and has been publicly disclosed, with an available proof-of-concept exploit.

Impact

Exploitation of this vulnerability leads to a heap-based buffer overflow, causing a segmentation fault and potentially allowing for arbitrary code execution.

Reproduction

The vulnerability can be reproduced by building mold with release optimization and AddressSanitizer (ASan) enabled. After building the application, it can be run with a crafted object file that triggers the buffer overflow. The AddressSanitizer will report the heap-buffer-overflow error, indicating that the vulnerability has been successfully exploited.

Added: Mar 12, 2026, 6:19 AM
Updated: Mar 12, 2026, 6:19 AM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
3.1
exploitability
4.6
remediation
0.0
relevance
3.8
threat
6.4
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.