Bug 1215024 (CVE-2015-3161)

Summary: search bar does not escape </script> tags when producing JSON
Product: [Retired] Beaker Reporter: Dan Callaghan <dcallagh>
Component: generalAssignee: Dan Callaghan <dcallagh>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: aigao, asaha, dcallagh, dowang, ebaak, huiwang, ineilsen, jskeoch, junichi.nomura, kueda, lzhuang, mjia, naoya.horiguchi, pen-test, rpotts, security-response-team, tatsu-ab1, tflink
Target Milestone: 20.1Keywords: Patch, Security
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-05-08 04:05:56 UTC Type: Bug
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:    
Bug Blocks: 1215894    
Attachments:
Description Flags
proposed patch none

Description Dan Callaghan 2015-04-24 07:13:06 UTC
Description of problem:
The search bar code for emitting the "search object" onto the page (JS object defining all possible search fields, operations, and values) does not correctly escape </script> tags appearing in string literals.

If the admin defines a key type or arch containing </script>... it will appear unescaped in the page.

Basically a dupe of bug 1209736 because the search bar code is not using tg.to_json like everything else.

Version-Release number of selected component (if applicable):
affects all Beaker versions since 2011 or earlier

How reproducible:
with admin access

Steps to Reproduce:
1. As an admin, add a key type: <script>alert('xss')</script>
2. Go to the systems page

Actual results:
'xss' alert appears. </script> is unescaped inside the JS string literal.

Expected results:
</script> is escaped correctly.

Comment 1 Dan Callaghan 2015-04-29 07:21:59 UTC
Created attachment 1020004 [details]
proposed patch

Comment 4 Hui Wang 2015-05-04 06:44:21 UTC
Verified this issue.
The result is PASS.
Version: Beaker 20.1.git.5.24dc482

Comment 5 Dan Callaghan 2015-05-08 04:05:56 UTC
Beaker 20.1 has been released.