Bug 1215024 (CVE-2015-3161) - search bar does not escape </script> tags when producing JSON
Summary: search bar does not escape </script> tags when producing JSON
Status: CLOSED CURRENTRELEASE
Alias: CVE-2015-3161
Product: Beaker
Classification: Community
Component: general
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified vote
Target Milestone: 20.1
Assignee: Dan Callaghan
QA Contact: tools-bugs
URL:
Whiteboard:
Keywords: Patch, Security
Depends On:
Blocks: 1215894
TreeView+ depends on / blocked
 
Reported: 2015-04-24 07:13 UTC by Dan Callaghan
Modified: 2018-02-06 00:41 UTC (History)
18 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2015-05-08 04:05:56 UTC


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

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.


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