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.

Comments

lilou’s picture

StatusFileSize
new656 bytes

Delete modules/node/node.install diff ;-)

pwolanin’s picture

can we mark as duplicate to: http://drupal.org/node/242873 ?

dww’s picture

Status: Needs review » Closed (duplicate)

Yes. ;) #242873: make drupal_set_title() use check_plain() by default. is the better solution to this problem.

bjaspan’s picture

Status: Closed (duplicate) » Needs review

#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.

bjaspan’s picture

Assigned: Unassigned » bjaspan
Priority: Normal » Critical
floretan’s picture

StatusFileSize
new2.49 KB

Same patch with a test case added.

bjaspan’s picture

Status: Needs review » Reviewed & tested by the community

flobruit: Thank you!

catch’s picture

Still applies.

lilou’s picture

StatusFileSize
new2.77 KB

Need to be re-rolled.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks all, and sorry for the delay.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.