All reports
Medium

perl-CGI: perl-CGI: Cross-site scripting via unescaped apostrophes in generated URLs

Affected versions

Affected versions
Unknown
Fixed version
Not reported
Affected versions
Unknown
Fixed version
Not reported
Affected versions
Unknown
Fixed version
Not reported
Affected versions
Unknown
Fixed version
Not reported

Exploitation

CVE-2026-120643

Probability of exploitation in the next 30 days: 0.32%

FIRST EPSS · 2026-11-24

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.

A flaw was found in perl-CGI. When constructing Uniform Resource Locators (URLs), the url() and self_url() functions fail to properly encode single quote characters in request paths or query parameters. A remote attacker can exploit this issue by submitting a crafted request to an application that embeds these URLs into single-quoted web page attributes or script blocks. This can result in cross-site scripting (XSS), allowing an attacker to execute malicious scripts in an affected user's browser and potentially access sensitive session data.