CVE-2020-36428
📋 TL;DR
This vulnerability in the matio library allows heap-based buffer overflow when processing specially crafted MAT files. Attackers could execute arbitrary code or cause denial of service. Any application using matio 1.5.18 through 1.5.21 to read MAT files is affected.
💻 Affected Systems
- matio (MAT File I/O Library)
📦 What is this software?
Matio by Matio Project
⚠️ Risk & Real-World Impact
Worst Case
Remote code execution leading to complete system compromise, data theft, or ransomware deployment.
Likely Case
Application crash (denial of service) or limited memory corruption leading to instability.
If Mitigated
Controlled crash with no code execution if memory protections (ASLR, DEP) are effective.
🎯 Exploit Status
Proof-of-concept available through OSS-Fuzz. Exploitation requires crafting a malicious MAT file and getting it processed by vulnerable software.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 1.5.22 and later
Vendor Advisory: https://github.com/tbeu/matio/releases
Restart Required: Yes
Instructions:
1. Identify applications using matio. 2. Update matio library to version 1.5.22 or later. 3. Rebuild applications if statically linked. 4. Restart affected services.
🔧 Temporary Workarounds
Input validation for MAT files
allImplement strict validation of MAT files before processing with matio library
Memory protection hardening
linuxEnable ASLR, DEP, and other memory protection mechanisms
sysctl -w kernel.randomize_va_space=2
🧯 If You Can't Patch
- Restrict processing of untrusted MAT files
- Isolate matio-dependent applications in containers or sandboxes
🔍 How to Verify
Check if Vulnerable:
Check matio version with: matio-config --version or ldd on binaries to check linked library version
Check Version:
matio-config --version || grep -r "libmatio" /usr/lib* || ldd <application> | grep matio
Verify Fix Applied:
Confirm matio version is 1.5.22 or later and test with known malicious MAT files
📡 Detection & Monitoring
Log Indicators:
- Application crashes with segmentation faults
- Memory corruption errors in application logs
- Unexpected process termination
Network Indicators:
- Unexpected MAT file transfers to vulnerable systems
- MAT files from untrusted sources
SIEM Query:
process.name="*" AND event.action="segmentation fault" AND process.args:"matio"