SB2022012523 - Multiple vulnerabilities in Pillow
Published: January 25, 2022
Breakdown by Severity
- Low
- Medium
- High
- Critical
Description
This security bulletin contains information about 3 secuirty vulnerabilities.
1) Exposed dangerous method or function (CVE-ID: CVE-2022-22817)
The vulnerability allows a remote attacker to compromise the affected system.
The vulnerability exists due to usage of PIL.ImageMath.eval() function on arbitrary expressions. A remote attacker can pass specially crafted file to the library and execute arbitrary code on the system.
2) Out-of-bounds read (CVE-ID: CVE-2022-22816)
The vulnerability allows a remote attacker to gain access to sensitive information.
The vulnerability exists due to buffer over-read during initialization of ImagePath.Path in path_getbbox() function in path.c. A remote attacker can pass a specially crafted file to the affected library and read contents of memory on the system.
3) Path traversal (CVE-ID: CVE-2022-22815)
The vulnerability allows a remote attacker to perform directory traversal attacks.
The vulnerability exists due to input validation error when processing directory traversal sequences in path_getbbox() function in path.c. A remote attacker can send a specially crafted HTTP request and read arbitrary files on the system.
Remediation
Install update from vendor's website.
References
- https://pillow.readthedocs.io/en/stable/releasenotes/9.0.0.html#restrict-builtins-available-to-imagemath-eval
- https://lists.debian.org/debian-lts-announce/2022/01/msg00018.html
- https://www.debian.org/security/2022/dsa-5053
- https://github.com/python-pillow/Pillow/blob/c5d9223a8b5e9295d15b5a9b1ef1dae44c8499f3/src/path.c#L331
- https://pillow.readthedocs.io/en/stable/releasenotes/9.0.0.html#fixed-imagepath-path-array-handling