CVE-2023-39125

7.5 HIGH

📋 TL;DR

CVE-2023-39125 is an integer overflow and out-of-bounds write vulnerability in NTSC-CRT's BMP loading function. Attackers can exploit this by providing specially crafted BMP files to potentially execute arbitrary code or crash the application. This affects users of NTSC-CRT 2.2.1 who process untrusted BMP files.

💻 Affected Systems

Products:
  • NTSC-CRT
Versions: 2.2.1
Operating Systems: All platforms where NTSC-CRT runs
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability exists in the loadBMP function in bmp_rw.c when processing BMP files with malformed width, height, or BPP values.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution leading to complete system compromise if the application runs with elevated privileges.

🟠

Likely Case

Application crash (denial of service) or limited memory corruption leading to unstable behavior.

🟢

If Mitigated

Application crash with no privilege escalation if running with minimal privileges in isolated environment.

🌐 Internet-Facing: MEDIUM - Exploitation requires processing attacker-controlled BMP files, which could occur through file uploads or network services.
🏢 Internal Only: LOW - Primarily affects local file processing; requires user interaction to open malicious files.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: MEDIUM

Exploitation requires crafting a malicious BMP file; no authentication needed to trigger the vulnerability when processing files.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: None

Vendor Advisory: https://github.com/LMP88959/NTSC-CRT/issues/32

Restart Required: No

Instructions:

No official patch available. Vendor considers this a demonstration program not intended for production use.

🔧 Temporary Workarounds

Input validation wrapper

all

Implement custom validation for BMP file dimensions before passing to loadBMP function

// Custom code required - validate width, height, BPP before calling loadBMP

Sandbox execution

all

Run NTSC-CRT in a sandboxed/containerized environment with limited privileges

docker run --read-only --cap-drop=ALL -v /safe/input:/input ntsc-crt

🧯 If You Can't Patch

  • Discontinue use of NTSC-CRT for processing untrusted BMP files
  • Implement application allowlisting to prevent execution of vulnerable NTSC-CRT binary

🔍 How to Verify

Check if Vulnerable:

Check if NTSC-CRT version is 2.2.1 and contains the vulnerable loadBMP function in bmp_rw.c

Check Version:

Check source code or binary metadata for version 2.2.1

Verify Fix Applied:

No official fix available; verify custom mitigations are implemented

📡 Detection & Monitoring

Log Indicators:

  • Application crashes when processing BMP files
  • Memory access violation errors

Network Indicators:

  • Unusual BMP file transfers to systems running NTSC-CRT

SIEM Query:

Process:NTSC-CRT AND (EventID:1000 OR ExceptionCode:c0000005)

🔗 References

📤 Share & Export