---
id: "CVE-2026-120640"
kind: "vulnerability"
aliases: ["CVE-2026-120640"]
title: "Perl CGI: request body parameters can be spoofed from query string"
severity: "medium"
cvss: null
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["cgi", "package", "perl", "web-apps"]
not_affected_if: ["cgi-not-used", "no-postdata-usage"]
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:16+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-120640", "first_seen_at": "2026-11-04T00:46:17+00:00"}]
---

# Perl CGI: request body parameters can be spoofed from query string

CGI.pm before 5.00 for Perl accepts POSTDATA, PUTDATA, PATCHDATA and XForms:Model as ordinary query or form fields, not only as real request bodies. An attacker can set these values from a cross-site HTML form, so an application reading them cannot tell client-sent data from the true body.

_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'`
- Look for code that calls `param('POSTDATA')`, `param('PUTDATA')`, `param('PATCHDATA')` or `param('XForms:Model')` and trusts the result

## Fix

- CGI for Perl: `5.00` or later (per the advisory's stated range)

## Timeline

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

## Documents

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

## From the sources

CGI versions before 5.00 for Perl allow the POSTDATA, PUTDATA, PATCHDATA and XForms:Model parameters to be set from the query string or form fields.

CGI stores a non-form request body under POSTDATA, PUTDATA or PATCHDATA, and an XForms body under XForms:Model, but also accepts these names from the query string, a form field or a multipart part, so an application cannot tell a client-sent value from the real body.

A cross-site HTML form can post POSTDATA={"admin":true} to an endpoint that reads JSON from param('POSTDATA'), a request forgery that needs no CORS preflight.

---

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