Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
node system
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
10 Jun 2008 at 02:07 UTC
Updated:
13 Sep 2008 at 13:12 UTC
Jump to comment: Most recent file
This bug was fixed by a previous D6 SA and never exited in D5, but has not yet been fixed in HEAD. To reproduce:
1. Create a node whose title is "
alert('xss')" (use actual < and > chars, not the HTML entities).
2. Save the node.
3. Click Edit. Observe the JS popup.
The culprit:
function node_page_edit($node) {
drupal_set_title($node->title);
return drupal_get_form($node->type .'_node_form', $node);
}
Contrast with D6's, which calls check_plain($node->title).
Patch attached. We need a test case for this; I haven't written one yet.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | node-title-xss-268706-7.patch | 2.77 KB | lilou |
| #6 | node-title-xss-268706-6.patch | 2.49 KB | floretan |
| #1 | node-title-xss_1.patch | 656 bytes | lilou |
| node-title-xss.patch | 2.94 KB | bjaspan |
Comments
Comment #1
lilou commentedDelete modules/node/node.install diff ;-)
Comment #2
pwolanin commentedcan we mark as duplicate to: http://drupal.org/node/242873 ?
Comment #3
dwwYes. ;) #242873: make drupal_set_title() use check_plain() by default. is the better solution to this problem.
Comment #4
bjaspan commented#1: Ooops, sorry about those node.install changes. That's a glimpse into the automated XSS detection approach I was toying with that revealed this bug.
#2: We can mark this a duplicate of #242873 if and only if that issue gets changed from "feature request, normal priority" to "bug report, critical priority" because this issue is an XSS security vulnerability. It is simpler just to fix this bug now by adding in the check_plain(), matching the current API, and then removing it in the patch for #242873 if/when that patch gets committed.
Comment #5
bjaspan commentedComment #6
floretan commentedSame patch with a test case added.
Comment #7
bjaspan commentedflobruit: Thank you!
Comment #8
catchStill applies.
Comment #9
lilou commentedNeed to be re-rolled.
Comment #10
dries commentedCommitted to CVS HEAD. Thanks all, and sorry for the delay.
Comment #11
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.