Views_rss doesn't apply input filters to fulltext output

TimK - May 30, 2007 - 00:26
Project:Views
Version:5.x-1.6
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:reviewed & tested by the community
Description

If you have your RSS feeds configured to output the full text of nodes, and you use views_rss to generate an RSS feed, the feed will have the raw body content of the nodes in the feed. However, the body content ought to have input filters applied.

To reproduce, set the RSS settings to include full-text (rather than just the teaser). Then look at the default frontpage view's feed, which is at frontpage/feed. The feed's items will have been output without input filtering.

This is a security bug, because it enables stored cross-site scripting attacks. Consider, if you have a site in which users may register and submit content all without prior approval. A malicious user could submit content with malicious JavaScript (or some other malicious code), which would then be transmitted, unfiltered, via any views RSS feeds. Any user who happens to look at the feed would have the malicious code run in his browser.

The fix is trivial. The return value of node_invoke() needs to be assigned to the output object, thusly:

142c142
< node_invoke($item, 'view', $teaser, FALSE);
---
> $item = node_invoke($item, 'view', $teaser, FALSE);

-TimK

#1

gnassar - June 8, 2007 - 19:27
Status:active» needs review

Had the same problem. TimK's patch seems to have fixed it. Nice catch!

Went ahead and made up a patch for it.

AttachmentSize
views_rss.module.HEAD_.patch 570 bytes

#2

gnassar - June 27, 2007 - 21:33
Status:needs review» reviewed & tested by the community

As a security bug, it'd be nice to get this into HEAD before the 6 freeze, I imagine, for any future branching.

#3

merlinofchaos - July 14, 2007 - 18:59
Status:reviewed & tested by the community» fixed

Committed to -dev! Thanks!

#4

Anonymous - July 28, 2007 - 19:00
Status:fixed» closed

#5

rfay - April 20, 2008 - 20:31
Version:5.x-1.6-beta5» 5.x-1.6
Status:closed» active

Although the CHANGELOG.txt for views 5.x-1.6 says that this patch was applied, it was not, and this bug still exists in 5.x-1.6.

#6

merlinofchaos - April 20, 2008 - 21:32
Status:active» reviewed & tested by the community
 
 

Drupal is a registered trademark of Dries Buytaert.