Bug 609573 (CVE-2010-2480)

Summary: CVE-2010-2480 Python-Mako (prior v0.3.4): Improper escaping of single quotes in escape.cgi (XSS)
Product: [Other] Security Response Reporter: Jan Lieskovsky <jlieskov>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: dmalcolm, kylev
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-10-19 09:12:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 607302, 608155    
Bug Blocks:    

Description Jan Lieskovsky 2010-06-30 16:04:24 UTC
Craig Younkins reported:
  [1] http://bugs.python.org/issue9061

that Python Mako, a template library written in Python, improperly escaped 
single quotes in escape.cgi. An attacker could use this flaw to conduct 
cross-site scripting (XSS) attacks.

References:
  [2] http://www.makotemplates.org/CHANGES

Sample public PoC (from [1]):
  Proof of concept:
  print """<body class='%s'></body>""" % cgi.escape("' onload='alert(1);' bad='")

CVE Request:
  [3] http://www.openwall.com/lists/oss-security/2010/06/30/9

Comment 1 Jan Lieskovsky 2010-07-03 17:29:28 UTC
The CVE identifier of CVE-2010-2480 has been assigned to this:

Mako before 0.3.4 relies on the cgi.escape function in the Python
standard library for cross-site scripting (XSS) protection, which
makes it easier for remote attackers to conduct XSS attacks via
vectors involving single-quote characters and a JavaScript onLoad
event handler for a BODY element.

References:
  [1] http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-2480
  [2] http://bugs.python.org/issue9061
  [3] http://www.makotemplates.org/CHANGES
  [4] http://secunia.com/advisories/39935