CVE-2024-47049: Czim/file handling Path Traversal Vulnerability

MODERATE
Advisory Identifier: GHSA-6rgh-r6j3-3223
CVSS 8.2
CWE-918 CWE-22
Published
Advisory Summary

CVE-2024-47049 is a MODERATE (CVSS 8.2) path traversal vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Czim/file handling libraries in the Packagist ecosystem. The issue involves czim/file-handling vulnerable to ssrf and directory traversal. Remediation is available by upgrading affected packages to version 1.5.0, 2.3.0.

CVE-2024-47049 at a Glance

CVE Identifier CVE-2024-47049
GHSA Identifier GHSA-6rgh-r6j3-3223
Severity MODERATE
CVSS v3.1 Base Score 8.2
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product Czim/file handling
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 8.2

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

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

How to Fix CVE-2024-47049

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

czim/file-handling fixed: 1.5.0
Upgrade czim/file-handling to 1.5.0
czim/file-handling fixed: 2.3.0
Upgrade czim/file-handling to 2.3.0
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 czim/file-handling

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-47049, inspect your project dependencies for Czim/file handling:

inspect dependencies for czim/file-handling

Analyze the terminal output to locate any version of Czim/file handling in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.5.0), 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-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In Czim/file handling, 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

The czim/file-handling package before 1.5.0 and 2.x before 2.3.0 (used with PHP Composer) does not properly validate URLs within makeFromUrl and makeFromAny, leading to SSRF, and to directory traversal for the reading of local files.

CVE-2024-47049 Affected Czim/file handling Versions

2 component(s)
Fixed Versions:
1.5.02.3.0
Product / Package Ecosystem Affected Versions Fixed Version
czim/file-handling
Packagist
< 1.5.0
1.5.0
czim/file-handling
Packagist
≥ 2.0.0
< 2.3.0
2.3.0

References

Frequently Asked Questions

What is CVE-2024-47049?
CVE-2024-47049 is a security vulnerability in Czim/file handling involving czim/file-handling vulnerable to SSRF and directory traversal under CWE-918: Server-Side Request Forgery (SSRF).
Which Czim/file handling versions are affected?
Affected versions include releases prior to 1.5.0, 2.3.0 across affected packages: czim/file-handling.
What version fixes CVE-2024-47049?
Upgrading to 1.5.0, 2.3.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is czim/file-handling affected?
Yes, czim/file-handling is affected in releases prior to 1.5.0, 2.3.0. Upgrade your dependency to 1.5.0, 2.3.0 or later.
What is the CVSS score of CVE-2024-47049?
CVE-2024-47049 has a CVSS v3.1 base score of 8.2 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N.
What CWE is associated with CVE-2024-47049?
CVE-2024-47049 is classified under CWE-918: Server-Side Request Forgery (SSRF) (The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.).
How can I check Packagist dependencies for CVE-2024-47049?
Run the dependency tree command: 'inspect dependencies for czim/file-handling'. 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-6rgh-r6j3-3223",
  "modified" : "2025-03-19T15:39:58Z",
  "published" : "2024-09-17T15:31:23Z",
  "aliases" : [ "CVE-2024-47049" ],
  "summary" : "czim/file-handling vulnerable to SSRF and directory traversal",
  "details" : "The czim/file-handling package before 1.5.0 and 2.x before 2.3.0 (used with PHP Composer) does not properly validate URLs within makeFromUrl and makeFromAny, leading to SSRF, and to directory traversal for the reading of local files.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:L/SI:L/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "czim/file-handling"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.5.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "czim/file-handling"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.3.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-47049"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/czim/file-handling/commit/95dfda850536bf35e684619598b9d02f4c97680d"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/czim/file-handling/commit/dcf879896efe3457f51af9c8eab9f70dfc709a99"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/czim/file-handling"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/czim/file-handling/blob/2.3.0/SECURITY.md"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22", "CWE-918" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-09-17T21:23:56Z",
    "nvd_published_at" : "2024-09-17T14:15:17Z"
  }
}