---
id: "CVE-2026-120641"
kind: "vulnerability"
aliases: ["CVE-2026-120641"]
title: "Perl CGI module: upload filenames keep client-supplied path components"
severity: "unknown"
cvss: null
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["cgi", "package", "perl", "web-apps"]
not_affected_if: ["generated-filenames", "no-file-uploads"]
published_at: "2026-11-04T00:17:25+00:00"
first_seen_at: "2026-11-04T00:46:17+00:00"
updated_at: "2026-11-04T00:48:14+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-120641", "first_seen_at": "2026-11-04T00:46:17+00:00"}]
---

# Perl CGI module: upload filenames keep client-supplied path components

CGI.pm versions before 5.00 return the filename of an uploaded file exactly as the client sent it, including ../ sequences and Windows paths. An application that saves uploads under that name can be tricked into writing files outside its intended directory.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the installed CGI module version with `perl -MCGI -e 'print $CGI::VERSION'`
- Search application code for calls that take the upload filename and save the file under it without stripping the path

## Fix

- CGI for Perl: `5.00` or later (per the NVD description)

## Timeline

- 2026-11-04T00:46:17+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-120641

## Documents

- [fix] Patch: github.com https://github.com/leejo/CGI.pm/commit/5379eb18e87b7f985613f5c4f7bae94478a4fa2f.patch

## From the sources

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.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
