CVE-2020-36279
📋 TL;DR
This CVE describes a heap-based buffer over-read vulnerability in Leptonica image processing library versions before 1.80.0. The flaw in rasteropGeneralLow function allows attackers to read memory beyond allocated buffers, potentially exposing sensitive information. Any application using vulnerable Leptonica versions for image processing is affected.
💻 Affected Systems
- Leptonica
- Applications using Leptonica library (e.g., Tesseract OCR, various image processing tools)
📦 What is this software?
Fedora by Fedoraproject
Fedora by Fedoraproject
Leptonica by Leptonica
⚠️ Risk & Real-World Impact
Worst Case
Information disclosure leading to memory content leakage, potentially exposing sensitive data like passwords, keys, or application memory structures.
Likely Case
Application crash (denial of service) when processing maliciously crafted images, potentially causing service disruption.
If Mitigated
Limited impact with proper input validation and sandboxing, though memory corruption risks remain.
🎯 Exploit Status
Proof-of-concept exists in OSS-Fuzz issue #22512. Exploitation requires crafting malicious images that trigger the buffer over-read.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 1.80.0
Vendor Advisory: https://github.com/DanBloomberg/leptonica/commit/3c18c43b6a3f753f0dfff99610d46ad46b8bfac4
Restart Required: Yes
Instructions:
1. Update Leptonica to version 1.80.0 or later. 2. Recompile any applications using Leptonica. 3. Restart affected services. 4. For packaged distributions, use system package manager: 'apt update && apt upgrade leptonica-dev' (Debian/Ubuntu) or 'yum update leptonica' (RHEL/CentOS).
🔧 Temporary Workarounds
Input Validation and Sanitization
allImplement strict validation of image inputs before processing with Leptonica functions
Sandbox Image Processing
linuxRun Leptonica-based image processing in isolated containers or sandboxes with limited permissions
docker run --read-only --cap-drop=ALL -v /tmp:/tmp:ro your-image-processor
🧯 If You Can't Patch
- Implement network-level restrictions to limit image uploads to trusted sources only
- Deploy application-level monitoring for crashes in image processing components
🔍 How to Verify
Check if Vulnerable:
Check Leptonica version: 'pkg-config --modversion leptonica' or check library files for version < 1.80.0
Check Version:
pkg-config --modversion leptonica || leptonica-version || grep 'LEPTONICA_VERSION' /usr/include/leptonica/allheaders.h
Verify Fix Applied:
Confirm version is 1.80.0 or later: 'pkg-config --modversion leptonica' should return >= 1.80.0
📡 Detection & Monitoring
Log Indicators:
- Application crashes during image processing
- Memory access violation errors
- Segmentation faults in Leptonica-related processes
Network Indicators:
- Unusual image upload patterns
- Multiple failed image processing requests
SIEM Query:
process_name:"your-app" AND (event_type:crash OR error_message:"segmentation fault" OR error_message:"buffer over-read")
🔗 References
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=22512
- https://github.com/DanBloomberg/leptonica/commit/3c18c43b6a3f753f0dfff99610d46ad46b8bfac4
- https://github.com/DanBloomberg/leptonica/compare/1.79.0...1.80.0
- https://lists.debian.org/debian-lts-announce/2021/03/msg00037.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/JQUEA2X6UTH4DMYCMZAWE2QQLN5YANUA/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/RD5AIWHWE334HGYZJR2U3I3JYKSSO2LW/
- https://security.gentoo.org/glsa/202107-53
- https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=22512
- https://github.com/DanBloomberg/leptonica/commit/3c18c43b6a3f753f0dfff99610d46ad46b8bfac4
- https://github.com/DanBloomberg/leptonica/compare/1.79.0...1.80.0
- https://lists.debian.org/debian-lts-announce/2021/03/msg00037.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/JQUEA2X6UTH4DMYCMZAWE2QQLN5YANUA/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/RD5AIWHWE334HGYZJR2U3I3JYKSSO2LW/
- https://security.gentoo.org/glsa/202107-53