CVE-2026-120641: CGI versions before 5.00 for Perl return upload filenames with any client-supplied path, including ../ and Windows paths
Stig Palmquist 03 Nov 2026 23:54 UTC
========================================================================
CVE-2026-120641 CPAN Security Group
========================================================================
CVE ID: CVE-2026-120641
Distribution: CGI
Versions: before 5.00
MetaCPAN: https://metacpan.org/dist/CGI
VCS Repo: https://github.com/leejo/CGI.pm
CGI versions before 5.00 for Perl return upload filenames with any
client-supplied path, including ../ and Windows paths
Description
-----------
CGI versions before 5.00 for Perl return upload filenames with any
client-supplied path, including ../ and Windows paths.
The name returned for an uploaded file is the filename parameter of the
part's Content-Disposition header, unchanged.
An application that saves the upload under this name can be made to
write outside the intended directory.
Problem types
-------------
- CWE-22 Improper Limitation of a Pathname to a Restricted Directory
('Path Traversal')
Workarounds
-----------
For deployments that cannot upgrade, do not use the client-supplied
upload filename as a path.
Solutions
---------
Upgrade to CGI 5.00 or later.
References
----------
https://metacpan.org/release/LEEJO/CGI-4.72/source/lib/CGI.pm
https://metacpan.org/release/LEEJO/CGI-5.00/changes
https://github.com/leejo/CGI.pm/commit/5379eb18e87b7f985613f5c4f7bae94478a4fa2f.patch