CVE-2026-120643

CGI versions from 4.62 before 5.00 for Perl allow cross-site scripting via a raw apostrophe in URLs returned by url and self_url

Published Nov 3, 2026 CVSS 3.1 · 6.1 Medium EPSS < 1% KEV · Not listed
Description
CGI versions from 4.62 before 5.00 for Perl allow cross-site scripting via a raw apostrophe in URLs returned by url and self_url.

Both pass the URL through URI's canonical method, which leaves an apostrophe in the path raw and decodes the %27 that query parameter escaping produces, so an apostrophe in the request path or a parameter appears raw in the result.

An application that places the URL in a single-quoted HTML attribute or JavaScript string is open to cross-site scripting.

Analysis

AI-generated

Technical impact

CGI modules from version 4.62 up to, but not including, 5.00 expose URLs in attributes or script contexts without proper encoding. The vulnerability allows a forged request containing a literal apostrophe or a URL‑encoded %27 to be reflected back to the client exactly as typed, enabling injection of malicious JavaScript when the URL is placed inside a single‑quoted HTML attribute or a JavaScript string. This results in a cross‑site scripting (XSS) vulnerability that can be exploited to steal cookies, session data, or perform other client‑side attacks.

Affected Systems

The affected product is the Perl CGI module (CGI.pm). Versions 4.62 through any pre‑5.00 release (e.g., 4.72, 4.80, 4.99) contain the flaw. Applications that import and use CGI.pm for generating URLs via the url or self_url functions are at risk.

Risk and Exploitability

The CVSS score is 6.1, and the EPSS score is unavailable, but the vulnerability is capable of facilitating script injection in browsers that render the reflected content. Exploitation requires an attacker to craft a URL with an embedded apostrophe and to have the victim load a page that outputs that URL unescaped within a single‑quoted context. Because the flaw is in the library, the attack vector is a standard web request; no privileged access or additional credentials are necessary. The vulnerability is listed as not yet in the CISA KEV catalog, suggesting that widespread exploitation has not been observed at this time, but the potential impact remains high for affected sites that use the CGI functions indiscriminately.

Remediation

Vendor Solution

Upgrade to CGI 5.00 or later.


OpenCVE Recommended Actions

  • Upgrade the CGI module to version 5.00 or later, which removes the raw apostrophe handling flaw.
  • If upgrading is not immediately possible, explicitly HTML‑escape or JavaScript‑escape URLs returned by url or self_url before inserting them into single‑quoted attributes or script blocks.
  • Modify application code to avoid using url or self_url when the result is incorporated into raw HTML contexts; prefer helper functions that perform proper escaping or use templating systems that automatically escape injected data.

Generated by OpenCVE AI on November 4, 2026 at 13:40 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

{'score': 6.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N'}

threat_severity

Moderate

Type Values Removed Values Added
Description CGI versions from 4.62 before 5.00 for Perl allow cross-site scripting via a raw apostrophe in URLs returned by url and self_url. Both pass the URL through URI's canonical method, which leaves an apostrophe in the path raw and decodes the %27 that query parameter escaping produces, so an apostrophe in the request path or a parameter appears raw in the result. An application that places the URL in a single-quoted HTML attribute or JavaScript string is open to cross-site scripting.
Title CGI versions from 4.62 before 5.00 for Perl allow cross-site scripting via a raw apostrophe in URLs returned by url and self_url
Weaknesses CWE-79
References

Subscriptions

No data.

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Sources

Status
PUBLISHED
Assigner
CPANSec
Published
Updated
Nov 9, 2026, 7:24 PM
Reserved
Nov 2, 2026, 5:42 PM
Status
Deferred
Published
Nov 4, 2026, 12:17 AM
Modified
Nov 9, 2026, 8:18 PM
Severity
Moderate
Public date
Nov 3, 2026, 11:40 PM