---
id: "CVE-2026-120647"
kind: "vulnerability"
aliases: ["CVE-2026-120647"]
title: "Perl CGI: unescaped quotes let attachment filenames be spoofed"
severity: "low"
cvss: null
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["cgi", "package", "perl", "web-apps"]
not_affected_if: ["cgi-5.00-or-later", "fixed-attachment-names"]
published_at: "2026-11-04T00:17:26+00:00"
first_seen_at: "2026-11-04T00:46:17+00:00"
updated_at: "2026-11-04T00:48:07+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-120647", "first_seen_at": "2026-11-04T00:46:17+00:00"}]
---

# Perl CGI: unescaped quotes let attachment filenames be spoofed

The Perl CGI module before 5.00 does not escape double quotes when it writes an attachment filename into the Content-Disposition header. An attacker who controls the attachment name can add a second filename parameter and change the name a browser saves the response under.

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

## How to check

- Look for `CGI` in the Perl module list, for example `perl -MCGI -e 'print $CGI::VERSION'`
- Search the codebase for `header(-attachment` calls that pass request data as the name

## Fix

- Perl CGI: move to `5.00` or later

## Timeline

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

## Documents

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

## From the sources

CGI versions before 5.00 for Perl allow Content-Disposition parameter injection via unescaped double quotes in the header attachment filename.

header(-attachment => $name) writes $name into the quoted filename parameter of Content-Disposition without escaping double quotes.

An application that passes request data as the attachment name can be made to send a second filename parameter, changing the name the response is saved under.

---

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