Make WordPress Core

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#19014 closed defect (bug) (invalid)

Titles containing JavaScript execute the JavaScript - XSS risk

Reported by: dbvista Owned by:
Priority: normal Milestone:
Component: General Version: 3.2.1
Severity: major Keywords:
Cc: Focuses:

Description

I created a post with this title:

<script lang="javascript">alert('hacked');</script>

When the article rendered, the alert box rendered too. This means WordPress is vulnerable to JavaScript-based attacks such as cross-site scripting (XSS).

Change History (4)

#1 @dbvista
15 years ago

Here's another great title:

<script language="javascript">document.location='​http://www.you-are-hacked.com';</script>

which directs the browser to a malicious site.

#2 @rianjs
15 years ago

Working example:

Direct link to post:
​http://rianjs.net/2011/10/alertfoo

Homepage with the post on it:
​http://rianjs.net

Both trigger the JS.

#3 @ryan
15 years ago

  • Milestone Awaiting Review
  • Resolution → invalid
  • Status new → closed

Administrators and Editors have the unfiltered_html capability and are allowed to do this.

#4 @dbvista
15 years ago

Thanks. I re-tried this as an Author and the JavaScript did not execute.

Note: See TracTickets for help on using tickets.