CVE-2021-32708
Time-of-check Time-of-use (TOCTOU) Race Condition in league/flysystem
Reported by github_m · Published June 24, 2021
league/flysystem is fixed in 2.1.1 and 1.1.4 (Packagist)
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| league/flysystem | Packagist | 2.1.1, 1.1.4 |
| flysystem | thephpleague | 2.1.1, 1.1.4 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| thephpleague | flysystem | < 1.1.4, >= 2.0.0, < 2.1.1 |
| league | flysystem | 1.0.0, 2.0.0 |
| thephpleague | flysystem | 0, 2.0.0 |
Timeline
- Jun 24, 2021 CVE Published
- Jun 25, 2021 EPSS Score (30 in total, the first dated here)
- Feb 8, 2023 PoC Published
- Apr 9, 2026 Security Advisory
- Aug 1, 2026 Coalition ESS Score
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2021-32708
vulnetix vdb fixes CVE-2021-32708
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2021-32708/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- x_refsource_CONFIRM
- x_refsource_MISC
- x_refsource_MISC
- x_refsource_MISC
- FEDORA-2021-717516a2e9 vendor-advisoryx_refsource_FEDORA
- FEDORA-2021-b9187c535c vendor-advisoryx_refsource_FEDORA
- https://nvd.nist.gov/vuln/detail/CVE-2021-32708 advisory