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 Stig Palmquist 03 Nov 2026 23:55 UTC

========================================================================
CVE-2026-120643                                      CPAN Security Group
========================================================================

        CVE ID:  CVE-2026-120643

  Distribution:  CGI
      Versions:  from 4.62 before 5.00
      MetaCPAN:  https://metacpan.org/dist/CGI
      VCS Repo:  https://github.com/leejo/CGI.pm

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

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.

Problem types
-------------
- CWE-79 Improper Neutralization of Input During Web Page Generation
  ('Cross-site Scripting')

Solutions
---------
Upgrade to CGI 5.00 or later.

References
----------
https://metacpan.org/release/LEEJO/CGI-4.72/source/lib/CGI.pm
https://metacpan.org/release/LEEJO/CGI-5.00/changes
https://github.com/leejo/CGI.pm/commit/851430be84c4d0f350681814e1d7718b9959f2c2.patch