---
id: "CVE-2026-120648"
kind: "vulnerability"
aliases: ["CVE-2026-120648"]
title: "Perl CGI: unescaped comment text lets attackers inject HTML"
severity: "low"
cvss: null
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["cgi", "package", "perl", "web-apps"]
not_affected_if: ["no-request-data-in-comments", "version-5.00-or-later"]
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:06+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-120648", "first_seen_at": "2026-11-04T00:46:17+00:00"}]
---

# Perl CGI: unescaped comment text lets attackers inject HTML

CGI.pm versions before 5.00 for Perl place arguments inside HTML comments without escaping, so text containing --> closes the comment early. An application that passes request data into the comment helper can have HTML injected into its pages.

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

## How to check

- Find the Perl CGI module version with `perl -MCGI -e 'print $CGI::VERSION'`
- Search application code for calls to the CGI comment helper that receive request data

## Fix

- CGI for Perl: `5.00` or later (per the NVD description; confirm against the patch link)

## Timeline

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

## Documents

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

## From the sources

CGI versions before 5.00 for Perl allow HTML injection via text containing --> in comment.

Arguments are placed between <!-- and --> without escaping, so text containing --> closes the comment early.

An application that passes request data to comment can be made to inject HTML into the page.

---

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