r888888888/danbooru — pull request #2273 by evazion (2014-10-17 20:19:09+00:00)
Title: Fix XSS in source link on post show page.

This vulnerability allows someone to create a source link that appears
to lead to Pixiv like normal, but that actually executes Javascript code
when clicked.

1) Set the source of a post to `javascript:"http://img1.pixiv.net/img/xss/";alert("xss");`
2) Wait for someone to click the source link in the Information sidebar.
3) Profit.

The cause is that the regexes for detecting Pixiv URLs aren't anchored
to the front of the string using \A. This allows non-http:// links to be
created.