CVE-2021-44335

7.8 HIGH

📋 TL;DR

CVE-2021-44335 is a heap buffer overflow vulnerability in the ok-file-formats library's PNG processing function. Attackers can exploit this by providing specially crafted PNG files, potentially leading to arbitrary code execution or application crashes. Any software using the vulnerable ok-file-formats library is affected.

💻 Affected Systems

Products:
  • ok-file-formats library
  • Applications using ok-file-formats for PNG processing
Versions: Versions up to commit 203defd (specific version numbers not clearly documented)
Operating Systems: All platforms where ok-file-formats is used
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerability exists in the default PNG processing functionality. Applications must be using the ok_png_transform_scanline() function.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution with the privileges of the application processing the malicious PNG file, potentially leading to complete system compromise.

🟠

Likely Case

Application crash (denial of service) when processing malicious PNG files, with potential for information disclosure from heap memory.

🟢

If Mitigated

Application crash with limited impact if proper sandboxing and memory protections are enabled.

🌐 Internet-Facing: MEDIUM - Requires processing of attacker-controlled PNG files, which could occur through file upload features or web content.
🏢 Internal Only: LOW - Requires local file processing or internal file sharing of malicious PNGs.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: MEDIUM

Proof of concept demonstrates crash via heap buffer overflow. Full RCE exploitation would require bypassing modern memory protections.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Fixed in commit after 203defd (specific version not documented)

Vendor Advisory: https://github.com/brackeen/ok-file-formats/issues/17

Restart Required: Yes

Instructions:

1. Update ok-file-formats library to latest version. 2. Rebuild applications using the library. 3. Restart affected services.

🔧 Temporary Workarounds

Disable PNG processing

all

Disable PNG file processing in applications using ok-file-formats if not required

Input validation

all

Implement strict validation of PNG files before processing

🧯 If You Can't Patch

  • Implement network segmentation to isolate systems using vulnerable library
  • Deploy application allowlisting to prevent execution of unauthorized binaries

🔍 How to Verify

Check if Vulnerable:

Check if application uses ok-file-formats library and version. Test with proof-of-concept PNG file from GitHub issue.

Check Version:

Check build configuration or dependency files for ok-file-formats version reference

Verify Fix Applied:

Verify library version is updated beyond vulnerable commit. Test with same proof-of-concept PNG file to confirm no crash.

📡 Detection & Monitoring

Log Indicators:

  • Application crashes when processing PNG files
  • Memory access violation errors in application logs

Network Indicators:

  • Unusual PNG file uploads to web applications
  • PNG files with abnormal structure

SIEM Query:

source="application.log" AND ("segmentation fault" OR "heap overflow" OR "access violation") AND "png"

🔗 References

📤 Share & Export