Plataforma
python
Componente
pillow
Corregido en
3.1.1
CVE-2016-4009 is a critical integer overflow vulnerability affecting versions of Pillow (PIL) up to 3.1.0rc1. This flaw resides within the ImagingResampleHorizontal function, specifically when handling negative size values during image resampling. Successful exploitation can lead to a heap-based buffer overflow, potentially allowing for arbitrary code execution. The vulnerability was published in 2018 and a fix is available in version 3.1.1.
The integer overflow in Pillow's ImagingResampleHorizontal function creates a significant security risk. An attacker can craft malicious image files that, when processed by an application using a vulnerable Pillow version, trigger a heap buffer overflow. This overflow can overwrite critical memory regions, potentially allowing the attacker to execute arbitrary code on the system. The impact is particularly severe in server-side applications that process user-uploaded images, as it could lead to remote code execution and complete system compromise. The potential for remote code execution makes this a high-priority vulnerability to address.
CVE-2016-4009 has been publicly disclosed and a proof-of-concept may exist. While active exploitation campaigns are not widely reported, the vulnerability's critical severity and potential for remote code execution make it a valuable target for attackers. It is not currently listed on CISA KEV. Public disclosure occurred on 2018-07-24.
Applications and systems that rely on Pillow for image processing are at risk, particularly those handling user-uploaded images. This includes web applications, image editing software, and any system that integrates Pillow into its image manipulation pipeline. Legacy systems running older versions of Python and Pillow are particularly vulnerable.
• python / server:
import Pillow
def check_pillow_version():
try:
import Pillow
version = Pillow.__version__
if version <= '3.1.0rc1':
print("Vulnerable Pillow version detected: {}".format(version))
else:
print("Pillow version is safe: {}".format(version))
except ImportError:
print("Pillow is not installed.")
check_pillow_version()discovery
disclosure
Estado del Exploit
EPSS
5.26% (90% percentil)
Vector CVSS
The primary mitigation for CVE-2016-4009 is to upgrade Pillow to version 3.1.1 or later. If upgrading is not immediately feasible due to compatibility issues or application downtime concerns, consider implementing input validation to restrict the size values passed to the resize function. While not a complete solution, this can reduce the attack surface. Additionally, consider using a Web Application Firewall (WAF) to filter potentially malicious image uploads. After upgrading, confirm the fix by attempting to process a known malicious image file (if available) and verifying that no crash or unexpected behavior occurs.
Sin parche oficial disponible. Busca alternativas o monitorea actualizaciones.
Análisis de vulnerabilidades y alertas críticas directamente en tu correo.
CVE-2016-4009 is a critical integer overflow vulnerability in Pillow image processing library, affecting versions up to 3.1.0rc1. It allows attackers to trigger a heap buffer overflow via malicious image files.
You are affected if you are using Pillow versions 3.1.0rc1 or earlier. Check your Pillow version using python -c "import Pillow; print(Pillow.version)". If it's vulnerable, upgrade immediately.
Upgrade Pillow to version 3.1.1 or later. This resolves the integer overflow vulnerability. Consider input validation as a temporary workaround if immediate upgrade is not possible.
While widespread active exploitation is not confirmed, the vulnerability's severity and potential for remote code execution make it a likely target for attackers. Proactive mitigation is recommended.
Refer to the Pillow project's security advisories and release notes for details: https://pillow.readthedocs.io/en/stable/releasenotes.html
Sube tu archivo de dependencias y detecta esta y otras CVEs al instante.
Sube tu archivo requirements.txt y te decimos al instante si estás afectado.