CVE-2024-39919
JSON

3.1low

Capture screenshot of localhost web services (unauthenticated pages) in @jmondi/url-to-png

Severity
3.1low CVSS:3.1 by GitHub_M
Exploit likelihood
0.37% (higher than 33% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-342q-2mc2-5gmp

Description

@jmondi/url-to-png is an open source URL to PNG utility featuring parallel rendering using Playwright for screenshots and with storage caching via Local, S3, or CouchDB. The package includes an `ALLOW_LIST` where the host can specify which services the user is permitted to capture screenshots of. By default, capturing screenshots of web services running on localhost, 127.0.0.1, or the [::] is allowed. If someone hosts this project on a server, users could then capture screenshots of other web services running locally. This issue has been addressed in version 2.1.1 with the addition of a blocklist. Users are advised to upgrade. There are no known workarounds for this vulnerability.

Affected

Product or packageVersionsReported by
jasonraimondi url-to-png< 2.1.1, 2.1.1CVE List
@jmondi/url-to-png (npm)before 2.1.2GitHub Advisory Database

All scores

GitHub_M3.1low CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:N/A:N
GitHub3.7medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:N/SA:N

Classification

CWE-200

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.

What each source says

CVE List

@jmondi/url-to-png is an open source URL to PNG utility featuring parallel rendering using Playwright for screenshots and with storage caching via Local, S3, or CouchDB. The package includes an `ALLOW_LIST` where the host can specify which services the user is permitted to capture screenshots of. By default, capturing screenshots of web services running on localhost, 127.0.0.1, or the [::] is allowed. If someone hosts this project on a server, users could then capture screenshots of other web services running locally. This issue has been addressed in version 2.1.1 with the addition of a blocklist. Users are advised to upgrade. There are no known workarounds for this vulnerability.

GitHub Advisory Database
Summary

The maintainer been contemplating whether FTP or other protocols could serve as useful functionalities, but there may not be a practical reason for it since we are utilizing headless Chrome to capture screenshots. The argument is based on the assumption that this package can function as a service.

The package includes an ALLOW_LIST where the host can specify which services the user is permitted to capture screenshots of. By default, capturing screenshots of web services running on localhost, 127.0.0.1, or the [::] is allowed.

The maintainer is of the opinion that the package should also have a blacklist due to a potential vulnerability (or rather design oversight). If someone hosts this on a server, users could then capture screenshots of other web services running locally.

Unless this is strictly for web pages. Something similar here: https://github.com/follow-redirects/follow-redirects/issues/235 (localhost is intended for end users or hosts to deny, and the package is for HTTP/HTTPS.)

This is marked as a LOW since the maintainer is not sure if this is a vulnerability, but it's still best to highlight it. :)

PoC

Have a service like so running locally:

const http = require("http")

const server = http.createServer((req, res) => {
  console.log("Received headers:", req.headers)
  res.writeHead(200, { "Content-Type": "text/plain" })
  res.end("Something private! But Hello from Server 2 :)")
})

server.listen(3001, () => {
  console.log("Server two running on http://localhost:3001")
})

Run the package in dev mode, pnpm dev. Feed these URLs:

http://localhost:3089/?url=http://[::]:3001&width=4000
http://localhost:3089/?url=http://localhost:3001&width=4000
http://localhost:3089/?url=http://127.0.01:3001&width=4000
image
Impact

Disclose internal web services?

NVD (es)

@jmondi/url-to-png es una utilidad de código abierto de URL a PNG que presenta renderizado paralelo usando Playwright para capturas de pantalla y con almacenamiento en caché a través de Local, S3 o CouchDB. El paquete incluye una `ALLOW_LIST` donde el host puede especificar de qué servicios el usuario puede realizar capturas de pantalla. De forma predeterminada, se permite realizar capturas de pantalla de servicios web que se ejecutan en localhost, 127.0.0.1 o [::]. Si alguien aloja este proyecto en un servidor, los usuarios podrían capturar capturas de pantalla de otros servicios web que se ejecutan localmente. Este problema se solucionó en la versión 2.1.1 con la adición de una lista de bloqueo. Se recomienda a los usuarios que actualicen. No se conocen workarounds para esta vulnerabilidad.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-39919 changed 2024-08-02CVE Terms of Use
GitHub Advisory DatabaseGHSA-342q-2mc2-5gmp changed 2026-09-10CC-BY-4.0
NVDCVE-2024-39919 changed 2026-06-17Public domain