Medium

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

  • Disclosed: 15.07.2024
  • Updated: 11.10.2026 10:22

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:

js
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
<img width="622" alt="image" src="https://github.com/jasonraimondi/url-to-png/assets/42532003/21f1c883-ba00-4a15-83b8-922484fa4c2b">

Impact

Disclose internal web services?

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package @jmondi/url-to-png < 2.1.2 2.1.2

References

CVSS score 3.7/10
CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N
Weakness (CWE)
CWE-200
Platform
npm
Package
@jmondi/url-to-png
Disclosed
15.07.2024
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-342q-2mc2-5gmp - CC BY 4.0

Vulnerability history: @jmondi/url-to-png

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
3
First → latest
06.2024 07.2024
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • Medium 3

Disclosures per year

  1. 2024: 3
  2. 2025: 0
  3. 2026: 0
  1. @jmondi/url-to-png enables capture screenshot of localhost web services (unauthenticated pages) this entry
    Medium · 3.7 CVE-2024-39919 < 2.1.2 2.1.2
  2. Medium · 5.3 CVE-2024-39918 < 2.1.2 2.1.2

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.