GHSA-gjx4-2c7g-fm94

Suggest an improvement
Source
https://github.com/advisories/GHSA-gjx4-2c7g-fm94
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/08/GHSA-gjx4-2c7g-fm94/GHSA-gjx4-2c7g-fm94.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-gjx4-2c7g-fm94
Aliases
Published
2025-08-19T20:17:45Z
Modified
2025-08-19T20:42:37Z
Severity
  • 9.8 (Critical) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
screenshot-desktop vulnerable to command Injection via `format` option
Details

Impact

This vulnerability is a command injection issue.
When user-controlled input is passed into the format option of the screenshot function, it is interpolated into a shell command without sanitization.
An attacker can craft malicious input such as:

{ format: "; echo vulnerable > /tmp/hello;" }

This results in arbitrary command execution with the privileges of the calling process.

Who is impacted:
Any application that accepts untrusted input and forwards it directly (or indirectly) into the format option is affected. If the library is used in a server-side context (e.g., API endpoints, web services), attackers may be able to exploit this remotely and without authentication, leading to full compromise of confidentiality, integrity, and availability.

CVSS v3.1 Base Score: 9.8 (Critical)
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Patches

The issue has been patched in version 1.15.2.
All users are strongly recommended to upgrade to 1.15.2 or later.
All earlier versions are vulnerable.

Workarounds

If upgrading is not immediately possible, developers should:

  • Strictly validate or whitelist acceptable format values (e.g., "jpeg", "png", "webp").
  • Reject or sanitize any unexpected input before passing it to the library.
  • Avoid allowing user-controlled data to reach the format option.

References

Database specific
{
    "cwe_ids":  [
        "CWE-77"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2025-08-19T20:17:45Z",
    "nvd_published_at":  "2025-08-19T18:15:29Z",
    "severity":  "CRITICAL"
}
References

Affected packages

npm / screenshot-desktop

Package

Name
screenshot-desktop
View open source insights on deps.dev
Purl
pkg:npm/screenshot-desktop

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
1.15.2

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/08/GHSA-gjx4-2c7g-fm94/GHSA-gjx4-2c7g-fm94.json"