Time-of-check Time-of-use (TOCTOU) Race Condition in league/flysystem
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- —
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub.
Summary
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.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| thephpleague | flysystem | before 1.1.4; 2.0.0 to before 2.1.1 | 1.1.4, 2.1.1 | Patch available | CNA |
| — | league/flysystem (Packagist) | before 1.1.4 | 1.1.4 | Patch available | GHSA-9f46-5r25-5wfm |
| — | league/flysystem (Packagist) | 2.0.0 to before 2.1.1 | 2.1.1 | Patch available | GHSA-9f46-5r25-5wfm |
- flysystem Vendorthephpleague Affected before 1.1.4; 2.0.0 to before 2.1.1 Fixed in 1.1.4, 2.1.1 Patch available CNA
- league/flysystem (Packagist) Vendor— Affected before 1.1.4 Fixed in 1.1.4 Patch available GHSA-9f46-5r25-5wfm
- league/flysystem (Packagist) Vendor— Affected 2.0.0 to before 2.1.1 Fixed in 2.1.1 Patch available GHSA-9f46-5r25-5wfm
CPE configurations NVD · 3
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:thephpleague:flysystem:*:*:*:*:*:*:*:* | 1.0.0 to before 1.1.4; 2.0.0 to before 2.1.1 | Vulnerable | thephpleague |
| cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:* | 33 | Vulnerable | Fedoraproject |
| cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:* | 34 | Vulnerable | Fedoraproject |
- cpe:2.3:a:thephpleague:flysystem:*:*:*:*:*:*:*:* Versions 1.0.0 to before 1.1.4; 2.0.0 to before 2.1.1 Vulnerable ·thephpleague
- cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:* Versions 33 Vulnerable ·Fedoraproject
- cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:* Versions 34 Vulnerable ·Fedoraproject
Remediation
- Fix · CNA flysystem (thephpleague) Fixed in 1.1.4, 2.1.1
- Fix · GHSA-9f46-5r25-5wfm league/flysystem (Packagist) Fixed in 1.1.4 Advisory →
- Fix · GHSA-9f46-5r25-5wfm league/flysystem (Packagist) Fixed in 2.1.1 Advisory →
Vendor assessments
Timeline
- 2026-10-02 Threatist record created from CVE-2021-32708
- 2026-10-03 Alias added: GHSA-9f46-5r25-5wfm
References
Patch 3
Advisory 4
Other 4
- https://github.com/FriendsOfPHP/security-advisories/blob/master/league/flysystem/CVE-2021-32708.yaml
- https://github.com/thephpleague/flysystem
- https://lists.fedoraproject.org/archives/list/[email protected]/message/NWPTENBYKI2IG47GI4DHAACLNRLTWUR5
- https://lists.fedoraproject.org/archives/list/[email protected]/message/RNZSWK4GOMJOOHKLZEOE5AQSLC4DNCRZ
Sources
- CVE-2021-32708 · CVE Program
- CVE-2021-32708 · NVD
- FIRST EPSS
- GHSA-9f46-5r25-5wfm · GitHub Advisory Database · CC BY 4.0
- CVE-2021-32708 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences