Comment 0 for bug 1472439

Revision history for this message
Aaron Wells (u-aaronw) wrote :

On artefact detail screens, when we you click on the "add to watchlist" link, we use AJAX to update the link to read "remove from watchlist". But, we are not properly escaping the page title in that AJAX, which makes it possible to execute Javascript that has been placed in the page title.

To replicate:

1. Create a portfolio Page
2. Give the page this title:

"><img src=0 onerror=alert(location)>

3. Put an image block in the page.
4. View the page in display mode.
5. Click on the link to view the artefact detail screen for the image
6. At the bottom of the artefact detail screen, click on the link that reads "Add page ""><img src=0 onerror=alert(location)>" to watchlist" or "Remove page ""><img src=0 onerror=alert(location)>" to watchlist"

Expected result: The page should be added or removed from your watchlist, and the link title should show the HTML-escaped version of the page title.

Actual result: The page is added or removed from your watchlist, but the link title is not HTML-escaped and Javascript "alert(location)" executes.