CVE-2024-24259
📋 TL;DR
CVE-2024-24259 is a memory leak vulnerability in freeglut library versions through 3.4.0. The vulnerability occurs in the glutAddMenuEntry function and allows attackers to gradually exhaust system memory through repeated exploitation. This affects any application using freeglut for OpenGL window management and menu functionality.
💻 Affected Systems
- freeglut
- applications using freeglut library
📦 What is this software?
Mupdf by Artifex
⚠️ Risk & Real-World Impact
Worst Case
Complete system memory exhaustion leading to denial of service, application crashes, and potential system instability affecting all applications on the host.
Likely Case
Gradual memory consumption causing application performance degradation, eventual crashes of freeglut-based applications, and potential service disruption.
If Mitigated
Minimal impact with proper memory monitoring and application restart policies in place.
🎯 Exploit Status
Exploitation requires the ability to call glutAddMenuEntry repeatedly. This typically requires some level of access or control over the application.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Versions after the fix in GitHub PR #155
Vendor Advisory: https://github.com/freeglut/freeglut/pull/155
Restart Required: Yes
Instructions:
1. Update freeglut to a patched version. 2. Recompile applications using freeglut with the updated library. 3. Restart affected applications.
🔧 Temporary Workarounds
Memory monitoring and restart
allMonitor memory usage of freeglut applications and restart them when memory consumption exceeds thresholds
# Monitor process memory usage
ps aux --sort=-%mem | grep application_name
# Set up monitoring with tools like monit or systemd
🧯 If You Can't Patch
- Implement application memory usage monitoring with automatic restart policies
- Limit user input that could trigger glutAddMenuEntry calls in vulnerable applications
🔍 How to Verify
Check if Vulnerable:
Check freeglut version: ldd /path/to/application | grep freeglut and verify version is 3.4.0 or earlier
Check Version:
pkg-config --modversion freeglut or check library file version
Verify Fix Applied:
Verify freeglut library version is updated beyond the vulnerable version and applications have been recompiled
📡 Detection & Monitoring
Log Indicators:
- Application crashes with out of memory errors
- System logs showing high memory usage by freeglut applications
Network Indicators:
- None - this is a local memory leak vulnerability
SIEM Query:
Process memory usage spikes for applications using freeglut library
🔗 References
- https://github.com/freeglut/freeglut/pull/155
- https://github.com/yinluming13579/mupdf_defects/blob/main/mupdf_detect_2.md
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/6IBAWX3HMMZVAWJZ3U6VOAYYOYJCN3IS/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/T43DAHPIWMGN54E4I6ABLHNYHZSTX7H5/
- https://github.com/freeglut/freeglut/pull/155
- https://github.com/yinluming13579/mupdf_defects/blob/main/mupdf_detect_2.md
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/6IBAWX3HMMZVAWJZ3U6VOAYYOYJCN3IS/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/T43DAHPIWMGN54E4I6ABLHNYHZSTX7H5/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/6IBAWX3HMMZVAWJZ3U6VOAYYOYJCN3IS/