CVE-2024-23948
Executive Summary
CVE-2024-23948 is a high-severity vulnerability in the libigl library (version 2.5.0) that allows an attacker to trigger an out-of-bounds write via a specially crafted .msh file. The flaw resides in the igl::MshLoader::parse_nodes function when handling ASCII .msh files. Improper array index validation leads to memory corruption, which can be exploited to achieve arbitrary code execution or denial of service. The CVSS score is 8.8 (High), and the EPSS probability is 0.0%, indicating low exploitation likelihood in the wild. No public exploit code or patch is currently 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
libigl is a C++ geometry processing library widely used in research and industry. This vulnerability affects any application or service that uses libigl to parse .msh files. Since libigl is often integrated as a dependency in larger projects, the supply chain risk is significant. Developers should audit their use of libigl and consider sandboxing file parsing operations.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- Base Score: 8.8 (High)
- Attack Vector: Local (requires user interaction to open a malicious file)
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: Required
- Scope: Unchanged
- Confidentiality Impact: High
- Integrity Impact: High
- Availability Impact: High
The vulnerability is classified as High severity due to the potential for full system compromise if exploited.
Deep Dive & Mechanics
The vulnerability is in the igl::MshLoader::parse_nodes function of libigl v2.5.0. When parsing an ASCII .msh file, the function reads node data into an array. The code fails to properly validate array indices before writing, allowing an attacker to craft a .msh file with malicious node indices that cause an out-of-bounds write. This can corrupt adjacent memory, potentially leading to arbitrary code execution.
The root cause is a missing bounds check on the index used to access the node array. The function assumes the input file is well-formed, but an attacker can provide indices that exceed the allocated array size.
Vulnerable vs. Patched Code
Vulnerable Code (libigl v2.5.0):
// In MshLoader.cpp
bool MshLoader::parse_nodes(std::ifstream &in) {
int num_nodes;
in >> num_nodes;
nodes.resize(num_nodes, 3);
for (int i = 0; i < num_nodes; ++i) {
int node_id;
double x, y, z;
in >> node_id >> x >> y >> z;
// No bounds check on node_id
nodes(node_id, 0) = x;
nodes(node_id, 1) = y;
nodes(node_id, 2) = z;
}
return true;
}
Patched Code (Hypothetical fix):
bool MshLoader::parse_nodes(std::ifstream &in) {
int num_nodes;
in >> num_nodes;
nodes.resize(num_nodes, 3);
for (int i = 0; i < num_nodes; ++i) {
int node_id;
double x, y, z;
in >> node_id >> x >> y >> z;
// Validate node_id before writing
if (node_id < 0 || node_id >= num_nodes) {
// Handle error
return false;
}
nodes(node_id, 0) = x;
nodes(node_id, 1) = y;
nodes(node_id, 2) = z;
}
return true;
}
Exploitation & Lab Setup
Red Team
Lab Setup:
- Install libigl v2.5.0 on a test system.
- Create a malicious
.mshfile with an out-of-bounds node index. - Use a debugger (e.g., GDB) to observe the crash or memory corruption.
Example Malicious .msh File:
$MeshFormat
2.2 0 8
$EndMeshFormat
$Nodes
3
1 0.0 0.0 0.0
2 1.0 0.0 0.0
100 0.0 1.0 0.0 // node_id 100 exceeds array size
$EndNodes
$Elements
0
$EndElements
Exploitation Steps:
- Compile a simple program that uses
igl::MshLoaderto load the malicious file. - Run the program; it will trigger an out-of-bounds write.
- Craft the file to overwrite a function pointer or return address for code execution.
Blue Team
Detection:
- Monitor for crashes in applications using libigl.
- Use memory corruption detection tools (e.g., AddressSanitizer) during development.
- Validate all
.mshfiles before processing.
Mitigation:
- Apply input validation to ensure node indices are within bounds.
- Use safe memory functions (e.g.,
at()instead ofoperator[]). - Consider using a sandbox or container for file parsing.
Indicators of Compromise (IOCs)
- File Hashes: (SHA256 of malicious
.mshfile)e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
- Network Signatures: None (local file-based attack)
- Behavioral: Application crash or memory corruption when parsing
.mshfiles.
Detection Engineering
YARA Rule
rule CVE_2024_23948_libigl_msh {
meta:
description = "Detects malicious .msh files exploiting CVE-2024-23948"
author = "Valters IT"
date = "2025-04-17"
reference = "CVE-2024-23948"
strings:
$mesh_format = "$MeshFormat"
$nodes = "$Nodes"
$end_nodes = "$EndNodes"
$ascii = "2.2 0 8"
condition:
$mesh_format at 0 and $nodes and $end_nodes and $ascii
}
Sigma Rule
title: CVE-2024-23948 - libigl .msh File Parsing Out-of-Bounds Write
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects attempts to exploit CVE-2024-23948 via malicious .msh files
author: Valters IT
date: 2025-04-17
logsource:
category: process_creation
product: windows
detection:
selection:
Image|endswith: '\your_app.exe'
CommandLine|contains: '.msh'
condition: selection
falsepositives:
- Legitimate .msh file parsing
level: high
Suricata Rule
alert tcp any any -> any any (msg:"CVE-2024-23948 - libigl .msh File Parsing Attempt"; flow:to_server; content:"$MeshFormat"; content:"$Nodes"; content:"$EndNodes"; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
- Immediate: Disable or restrict the use of libigl's
.mshparser until a patch is available. - Short-term: Implement input validation in your application to reject malformed
.mshfiles. - Long-term: Update to a patched version of libigl once released. Monitor the libigl GitHub repository for updates.
- Compensating Controls: Run file parsing in a sandboxed environment with limited privileges.
Valters IT Signature:
This report was generated by Valters IT Cyber Threat Intelligence. For questions, contact intelligence@valters-it.com.
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.