CVE-2025-52994: James heinrich/phpthumb PhpThumb Is Vulnerable To Command Vulnerability

MODERATE
Advisory Identifier: GHSA-q745-cfqh-hcrw
CVSS 4.9
CWE-78
Published
Advisory Summary

CVE-2025-52994 is a MODERATE (CVSS 4.9) phpthumb is vulnerable to command vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting James heinrich/phpthumb libraries in the Packagist ecosystem. The issue involves phpthumb is vulnerable to command injection through its gif_outputasjpeg function. Remediation is available in the latest vendor maintenance releases.

CVE-2025-52994 at a Glance

CVE Identifier CVE-2025-52994
GHSA Identifier GHSA-q745-cfqh-hcrw
Severity MODERATE
CVSS v3.1 Base Score 4.9
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product James heinrich/phpthumb
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 4.9

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2025-52994

To remediate this vulnerability, upgrade all affected James heinrich/phpthumb dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

james-heinrich/phpthumb fixed: Latest secure release
Upgrade james-heinrich/phpthumb to Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for james-heinrich/phpthumb

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-52994, inspect your project dependencies for James heinrich/phpthumb:

inspect dependencies for james-heinrich/phpthumb

Analyze the terminal output to locate any version of James heinrich/phpthumb in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In James heinrich/phpthumb, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

gif_outputAsJpeg in phpThumb through 1.7.23 allows phpthumb.gif.php OS Command Injection via a crafted parameter value. This is fixed in 1.7.23-202506081709.

CVE-2025-52994 Affected James heinrich/phpthumb Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
james-heinrich/phpthumb
Packagist
≤ 1.7.23

References

Frequently Asked Questions

What is CVE-2025-52994?
CVE-2025-52994 is a security vulnerability in James heinrich/phpthumb involving phpThumb is vulnerable to Command Injection through its gif_outputAsJpeg function under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which James heinrich/phpthumb versions are affected?
Affected versions include releases prior to current release patches across affected packages: james-heinrich/phpthumb.
What version fixes CVE-2025-52994?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is james-heinrich/phpthumb affected?
Yes, james-heinrich/phpthumb is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2025-52994?
CVE-2025-52994 has a CVSS v3.1 base score of 4.9 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2025-52994?
CVE-2025-52994 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check Packagist dependencies for CVE-2025-52994?
Run the dependency tree command: 'inspect dependencies for james-heinrich/phpthumb'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-q745-cfqh-hcrw",
  "modified" : "2025-07-11T22:36:20Z",
  "published" : "2025-07-11T15:31:39Z",
  "aliases" : [ "CVE-2025-52994" ],
  "summary" : "phpThumb is vulnerable to Command Injection through its gif_outputAsJpeg function",
  "details" : "gif_outputAsJpeg in phpThumb through 1.7.23 allows phpthumb.gif.php OS Command Injection via a crafted parameter value. This is fixed in 1.7.23-202506081709.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "james-heinrich/phpthumb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "1.7.23"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-52994"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/JamesHeinrich/phpThumb/commit/cdcbc206ae601b15fd17e7aadf59df51149a0e82"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/JamesHeinrich/phpThumb"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/JamesHeinrich/phpThumb/releases"
  }, {
    "type" : "WEB",
    "url" : "https://safety-online.pl/cve-2025-52994"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-78" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-07-11T22:36:20Z",
    "nvd_published_at" : "2025-07-11T15:15:27Z"
  }
}