REDHAT-BUG-963568: XSS
Eric Helms (ehelms) reports:
I have identified a number of areas and entities within Katello that are vulnerable to a cross-site scripting attack.
Reproducible: Always
Steps to Reproduce: 1. Log in 2. Navigate to Changeset/Repository/System/Distributor/Filter 3. Create a new entity from above giving it the name <a href="http://www.google.com">Entity 1</a> 4. Submit Actual Results: - Notification pops up saying success with a clickable link - Users can navigate to 'Notices' page and see clickable link from successful creation of the entity - If creating a Changeset, the changeset name will appear clickable inside the right hand list on the Changeset Management page
Expected Results: The name should appear fully escaped everywhere that it is used.
This is a two fold issue:
1. This issue is not present with some entities due to model validation on the backend that prevents the use of HTML <,>,/ characters. The entities defined above in the steps do not have this validation on their name property.
2. There are a few places where user input is not escaped on output. These locations are: - notices displayed to the user are marked as htmlsafe to account for the application putting links for the user into some notices, this has the downside of presenting all notices unescaped to the user and opening this XSS hole - in some areas of the application, JavaScript is used to construct templates and concatenate user input data from the server, since this data is not escaped when input to the JavaScript, the result comes out with an XSS hole
Affected Software
Event History
Frequently Asked Questions
Does exploitation require an authenticated user?
The documented reproduction starts by logging in, then creating an affected entity with HTML in its name. The provided data does not indicate that unauthenticated users can exploit it.
Which entity types are identified as lacking name validation?
The affected entity types named in the report are Changesets, Repositories, Systems, Distributors, and Filters. Some other entities may reject HTML characters through backend model validation, but these listed types do not have that protection on their name property.
Where can unsafe entity names be rendered to users?
Unsafe names can appear in success notifications and on the Notices page. Changeset names can also appear as clickable content in the right-hand list on the Changeset Management page.
How can an administrator verify whether the issue is present?
In a test environment, create one of the identified entity types using an HTML link as its name, then check the resulting success notification, Notices page, and, for a Changeset, the Changeset Management list. If the markup is rendered as a clickable link rather than escaped text, the issue is present.