Bug 1215024 - (CVE-2015-3161) search bar does not escape </script> tags when producing JSON
search bar does not escape </script> tags when producing JSON
Product: Beaker
Classification: Community
Component: general (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified (vote)
: 20.1
: ---
Assigned To: Dan Callaghan
: Patch, Security
Depends On:
Blocks: 1215894
  Show dependency treegraph
Reported: 2015-04-24 03:13 EDT by Dan Callaghan
Modified: 2018-02-05 19:41 EST (History)
18 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-05-08 00:05:56 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
proposed patch (6.90 KB, patch)
2015-04-29 03:21 EDT, Dan Callaghan
no flags Details | Diff

  None (edit)
Description Dan Callaghan 2015-04-24 03:13:06 EDT
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 03:21:59 EDT
Created attachment 1020004 [details]
proposed patch
Comment 4 Hui Wang 2015-05-04 02:44:21 EDT
Verified this issue.
The result is PASS.
Version: Beaker 20.1.git.5.24dc482
Comment 5 Dan Callaghan 2015-05-08 00:05:56 EDT
Beaker 20.1 has been released.

Note You need to log in before you can comment on or make changes to this bug.