PT-2024-28731 · Npm · @Jmondi/Url-To-Png
Realarcherl
·
Published
2024-07-15
·
Updated
2024-07-16
·
CVE-2024-39918
CVSS v4.0
6.9
Medium
| Vector | AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N |
Name of the Vulnerable Software and Affected Versions
@jmondi/url-to-png versions prior to 2.1.2
Description
The issue arises from the lack of sanitization of the
ImageId input in the code, leading to a path traversal vulnerability. This allows an attacker to store an image in an arbitrary location that the server has permission to access. The vulnerability is different from traditional path traversal issues, as it enables storing images in any location. There are no known workarounds for this issue.Recommendations
For versions prior to 2.1.2, upgrade to version 2.1.2 to address the issue. As a temporary workaround, consider sanitizing the
ImageId input by removing special characters from the parameters, such as using the slugify function for the params. For example, modify the imageId assignment to const imageId = dateString + "." + slugify(validData.url) + slugify(configToString(params));. This will help prevent path traversal attacks until the official patch is applied.Exploit
Fix
Path traversal
Found an issue in the description? Have something to add? Feel free to write us 👾
Weakness Enumeration
Related Identifiers
Affected Products
@Jmondi/Url-To-Png