LiveActive security incident?Get immediate response
CVE Record

CVE-2021-32708: Time-of-check Time-of-use (TOCTOU) Race Condition in league/flysystem

Flysystem is an open source file storage library for PHP. 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 are: 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. The unicode whitespace removal has been replaced with a rejection (exception). For 1.x users, upgrade to 1.1.4. For 2.x users, upgrade to 2.1.1.

CriticalCVSS 9.8Not KEV-listedUpdated
Glexia's TakeAutomated analysiscritical

Security readout for executives and security teams

Plain-English summary

This is a critical file-upload risk in PHP applications using vulnerable Flysystem versions. If several unsafe upload conditions align, a crafted filename can bypass extension blocking and allow uploaded PHP code to run. The source bundle does not show active exploitation.

Executive priority

Prioritize remediation where Flysystem supports public or partner upload features. The CVSS is critical, but business urgency depends on whether unsafe upload handling and executable storage directories exist in your environment.

Technical view

CVE-2021-32708 affects league/flysystem before 1.1.4 and 2.0.0 through before 2.1.1. Unicode whitespace normalization removed characters from paths or filenames, creating a TOCTOU-style extension handling issue when applications relied on deny-lists and executable upload directories.

Likely exposure

Exposure is most likely in PHP applications using Flysystem for user-controlled uploads, especially where users influence filenames or paths, extension deny-lists are used, Unicode characters are not rejected, and uploaded files reside where PHP execution is allowed.

Exploitation context

The advisory describes remote code execution only under specific combined conditions. KEV is false in the provided bundle, and no cited source states known active exploitation. Treat internet-facing upload workflows as the highest-priority review target.

Researcher notes

The vulnerability hinges on application context, not merely package presence. Confirm the vulnerable version, filename control, Unicode handling, deny-list logic, and web server execution behavior before declaring exploitable exposure. The fixed releases replaced whitespace normalization with rejection by exception.

Mitigation direction

  • Upgrade Flysystem 1.x deployments to 1.1.4 or later.
  • Upgrade Flysystem 2.x deployments to 2.1.1 or later.
  • Reject Unicode whitespace in user-supplied upload paths and filenames.
  • Use extension allow-lists instead of deny-lists for uploads.
  • Disable PHP execution in directories receiving uploaded files.
  • Check vendor and distribution guidance for packaged deployments.

Validation and detection

  • Inventory applications and lockfiles for league/flysystem versions.
  • Review upload paths where users control filenames or directories.
  • Confirm upload validation rejects Unicode whitespace characters.
  • Verify upload handling uses an allow-list, not only a deny-list.
  • Confirm uploaded files cannot execute as PHP.
  • Prioritize internet-facing and unauthenticated upload workflows.
Prepared
Confidence
high
Sources
7

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · low confidence lookup

CWE-367: Exact CWE lookup

Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
description · low confidence lookup

Execution behavior lookup

The CVE wording references code or command execution, so execution technique review may help defensive triage. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2021-32708 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
Critical
CVSS
9.8 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

1CVSS vectors
0Timeline events
0ADP providers
7Source links

CVSS vector scores

1 official score

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
9.8CVSS 3.1CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H3.95.9Primary CVE score

Vulnerability scoring details

Base CVSS 3.1 score

9.8Critical
CVSS 3.1 vector shape for CVE-2021-32708Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone

Source materials

Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
thephpleagueflysystem< 1.1.4, >= 2.0.0, < 2.1.1Listed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-367 · source CWE mapping

Time-of-check Time-of-use (TOCTOU) Race Condition

Time-of-check Time-of-use (TOCTOU) Race Condition represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.