CVE-2023-46049
Executive Summary
CVE-2023-46049 describes a NULL pointer dereference vulnerability in LLVM 15.0.0, specifically within the parseOneMetadata() function. The issue is triggered when processing a crafted pdflatex.fmt file (or potentially a crafted .o file) via the llvm-lto tool. The vulnerability leads to a crash due to a NULL pointer dereference. However, the report is disputed because the relationship between pdflatex.fmt and any LLVM language front end is not clearly explained, and a crash of the llvm-lto application is categorized by some as a usability problem rather than a security vulnerability. No official patch has been confirmed, and no public proof-of-concept (PoC) or exploit code is available.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability affects the LLVM toolchain, which is a critical component in many software supply chains. LLVM is used as a compiler infrastructure for various languages (C, C++, Rust, Swift, etc.). A crash in llvm-lto could disrupt build processes, potentially leading to denial of service in CI/CD pipelines. However, the disputed nature and lack of exploitability reduce the immediate supply chain risk.
CVSS Breakdown & Threat Level
The CVSS score is listed as 0.0, indicating that no official CVSS vector has been assigned. This is likely due to the disputed nature of the vulnerability. The threat level is considered Low because:
- The vulnerability only causes a crash (denial of service) in a specific tool (
llvm-lto). - No remote code execution or data breach is possible.
- The attack vector requires a crafted file to be processed locally.
- The report is disputed, reducing confidence in the severity.
Deep Dive & Mechanics
The vulnerability resides in the parseOneMetadata() function within LLVM's LTO (Link-Time Optimization) infrastructure. When llvm-lto processes a malformed input file (specifically a pdflatex.fmt file or a crafted .o file), the function attempts to dereference a pointer that has not been properly initialized or validated, leading to a NULL pointer dereference.
Technical Flow:
llvm-ltoreads the input file and parses metadata.- The
parseOneMetadata()function is called to extract metadata records. - Due to a missing or insufficient null check, a pointer is used without verifying it is non-null.
- The program crashes with a segmentation fault (SIGSEGV).
The disputed nature stems from the unclear relationship between pdflatex.fmt (a TeX format file) and LLVM's LTO. It is possible that the crash is triggered by an unexpected file format rather than a genuine security flaw.
Vulnerable vs. Patched Code
Since no official patch has been released, a direct comparison is not possible. However, the vulnerable code pattern is:
// Vulnerable pattern (pseudocode)
void parseOneMetadata(MetadataRecord *record) {
// Missing null check
record->field->value; // NULL pointer dereference if record->field is NULL
}
A patched version would include a null check:
// Patched pattern (pseudocode)
void parseOneMetadata(MetadataRecord *record) {
if (record->field == NULL) {
// Handle error gracefully
return;
}
record->field->value;
}
Exploitation & Lab Setup
Red Team
No public exploit code is available. To reproduce the crash:
- Set up a lab with LLVM 15.0.0 installed.
- Obtain a crafted
pdflatex.fmtfile (or craft a malformed.ofile). - Run
llvm-ltowith the crafted file:llvm-lto -o /dev/null crafted_file.fmt - Observe the crash (segmentation fault).
Blue Team
- Monitor for crashes of
llvm-ltoin logs. - Validate input files before processing with
llvm-lto. - Use file integrity monitoring to detect unexpected
.fmtor.ofiles.
Indicators of Compromise (IOCs)
- File Hashes: No specific hashes available.
- Process Names:
llvm-ltocrashing with SIGSEGV. - Log Entries: Segmentation fault errors in system logs (e.g.,
/var/log/syslogordmesg). - Network: No network indicators (local file processing only).
Detection Engineering
YARA Rule
rule CVE_2023_46049_NULL_Pointer_Dereference {
meta:
description = "Detects crafted files triggering NULL pointer dereference in LLVM 15.0.0 parseOneMetadata"
author = "Valters IT"
date = "2025-04-10"
cve = "CVE-2023-46049"
strings:
$magic_fmt = { 25 50 44 46 2D 31 2E 34 } // PDF-1.4 header (example)
$llvm_lto_crash = "parseOneMetadata" nocase
condition:
$magic_fmt at 0 and $llvm_lto_crash
}
Sigma Rule
title: LLVM LTO Crash via Crafted File
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects crashes of llvm-lto due to NULL pointer dereference (CVE-2023-46049)
author: Valters IT
date: 2025-04-10
logsource:
category: process_creation
product: linux
detection:
selection:
Image|endswith: '/llvm-lto'
CommandLine|contains: '.fmt'
condition: selection
falsepositives:
- Legitimate use of llvm-lto with .fmt files
level: low
Suricata Rule
alert tcp any any -> any any (msg:"CVE-2023-46049 LLVM LTO Crash Attempt"; flow:to_server; content:"|25 50 44 46|"; offset:0; depth:4; classtype:attempted-dos; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate: Avoid processing untrusted
.fmtor.ofiles withllvm-lto. - Short-term: Upgrade to a newer LLVM version if a patch becomes available. Monitor LLVM security advisories.
- Long-term: Implement input validation for all files processed by LLVM tools. Use sandboxing for build processes.
Valters IT Signature
Report generated by Valters IT DevSecOps AI. For questions, contact security@valters.it.
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.