Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

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

Source
Associated Vulnerability
Title:Time-of-check Time-of-use (TOCTOU) Race Condition in league/flysystem (CVE-2021-32708)
Description: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.
Description
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.
Readme
# CVE-2021-32708
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.
How the Exploit Works

Unicode Bypass: The filename exploit\u202Ephp.txt uses the Right-to-Left Override (RLO) character to disguise the file extension.

Malicious File Upload: The file is uploaded and stored on the server.

Payload Execution: If the server allows code execution in the uploads directory, the attacker can run the PHP payload remotely.
File Snapshot

[4.0K] /data/pocs/7791cccf73fad3aee830d31bbdb717fca90750f3 ├── [1.1K] CVE-2021-32708_exploit.py ├── [1.0K] CVE-2021-32708_scanner.py └── [ 626] README.md 0 directories, 3 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →