Race Condition Affecting league/flysystem package, versions <1.1.4>=2.0.0, <2.1.1


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
3.49% (88th 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 IDSNYK-PHP-LEAGUEFLYSYSTEM-1314353
  • published24 Jun 2021
  • disclosed24 Jun 2021
  • creditSteven Seeley

Introduced: 24 Jun 2021

CVE-2021-32708  (opens in a new tab)
CWE-362  (opens in a new tab)

How to fix?

Upgrade league/flysystem to version 1.1.4, 2.1.1 or higher.

Overview

league/flysystem is a File storage abstraction for PHP

Affected versions of this package are vulnerable to Race Condition. The whitespace normalisation using in 1.x and 2.x removes any unicode whitespace. Under certain specific conditions this could potentially allow a malicious user to execute code remotely. The conditions:

  • A user is allowed to supply the path or filename of an uploaded file.
  • The supplied path or filename is not checked against unicode chars.
  • The supplied pathname checked against an extension deny-list, not an allow-list.
  • The supplied path or filename contains a unicode whitespace char in the extension.
  • The uploaded file is stored in a directory that allows PHP code to be executed.

Given these conditions are met a user can upload and execute arbitrary code on the system under attack.

References

CVSS Base Scores

version 3.1