CVE-2018-14043

9.8 CRITICAL

📋 TL;DR

CVE-2018-14043 is an incorrect file access control vulnerability in mstdlib 1.2.0 that allows attackers to access sensitive data by creating files that lack proper permissions. The vulnerability occurs during copy operations when M_fs_perms_can_access attempts to delete existing files. Any application using the vulnerable mstdlib version is affected.

💻 Affected Systems

Products:
  • mstdlib (M Standard Library for C)
Versions: Version 1.2.0
Operating Systems: All operating systems where mstdlib is used
Default Config Vulnerable: ⚠️ Yes
Notes: Any application using mstdlib 1.2.0 for file operations is vulnerable. The vulnerability is in the library itself, not dependent on specific application configurations.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers could gain unauthorized access to sensitive files, potentially leading to data theft, privilege escalation, or system compromise.

🟠

Likely Case

Local attackers could read or modify files they shouldn't have access to, potentially accessing sensitive configuration or user data.

🟢

If Mitigated

With proper file permissions and access controls, the impact is limited to files the attacker already has some access to.

🌐 Internet-Facing: LOW - This appears to be a local file system vulnerability requiring local access to exploit.
🏢 Internal Only: MEDIUM - Internal users with local access could exploit this to access files beyond their permissions.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires local access to the system and knowledge of the vulnerable copy operation. The attacker needs to create files in specific locations.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Fixed in commit db124b8f607dd0a40a9aef2d4d468fad433522a7

Vendor Advisory: https://github.com/Monetra/mstdlib/commit/db124b8f607dd0a40a9aef2d4d468fad433522a7

Restart Required: Yes

Instructions:

1. Update mstdlib to a version containing commit db124b8f607dd0a40a9aef2d4d468fad433522a7
2. Recompile any applications using mstdlib
3. Restart affected services

🔧 Temporary Workarounds

Restrict file permissions

all

Apply strict file permissions to sensitive directories and files to limit potential damage

chmod 600 sensitive_file.txt
chmod 700 sensitive_directory/

Disable unnecessary file operations

all

If possible, disable or restrict copy operations in applications using mstdlib

🧯 If You Can't Patch

  • Implement strict file system access controls and monitoring
  • Isolate applications using mstdlib in containers or virtual machines with limited file system access

🔍 How to Verify

Check if Vulnerable:

Check if your application uses mstdlib version 1.2.0. Review source code or linked libraries for mstdlib usage.

Check Version:

Check build configuration or library dependencies for mstdlib version

Verify Fix Applied:

Verify the mstdlib version includes commit db124b8f607dd0a40a9aef2d4d468fad433522a7. Test file copy operations with restricted permissions.

📡 Detection & Monitoring

Log Indicators:

  • Unexpected file access attempts
  • Failed file permission checks during copy operations
  • Unauthorized file modifications

Network Indicators:

  • None - this is a local file system vulnerability

SIEM Query:

Search for file access events where source process uses mstdlib and accesses files outside expected permissions

🔗 References

📤 Share & Export