Skip to content

screenshot-desktop vulnerable to command Injection via `format` option

Critical severity GitHub Reviewed Published Aug 19, 2025 in bencevans/screenshot-desktop • Updated Aug 19, 2025

Package

npm screenshot-desktop (npm)

Affected versions

< 1.15.2

Patched versions

1.15.2

Description

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

References

@bencevans bencevans published to bencevans/screenshot-desktop Aug 19, 2025
Published by the National Vulnerability Database Aug 19, 2025
Published to the GitHub Advisory Database Aug 19, 2025
Reviewed Aug 19, 2025
Last updated Aug 19, 2025

Severity

Critical

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(52nd percentile)

Weaknesses

Improper Neutralization of Special Elements used in a Command ('Command Injection')

The product constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component. Learn more on MITRE.

CVE ID

CVE-2025-55294

GHSA ID

GHSA-gjx4-2c7g-fm94

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.