Postponed (maintainer needs more info)
Project:
Bbcode
Version:
6.x-1.2
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
15 Feb 2010 at 07:58 UTC
Updated:
9 Feb 2013 at 20:22 UTC
I noticed that Bbcode filter delete
tags. So i cannot use full features of slideshare embed widget (BBcode) with twitter embed widget (script tags), which uses script tag to load javascript library. Of course it can be done by custom editing of the body content, but i requires more experiences for editor users. Any idea? Thanx all
Comments
Comment #1
nileshgr commentedWhat do you mean by delete tags ?
Comment #2
boreg commentedSorry, i meant the
<script>html tagComment #3
nileshgr commentedIf your Input Format has HTML Filter enabled, then disable it and process HTML first then BBCode.
Comment #4
naudefj commentedFor security reasons we cannot allow users to enter script tags.
Comment #5
boreg commentedIts not issue of other filters. I disabled all of them. There is just only BBcode filter enabled. When i disable it, everything works fine - except transforming BBcode to html naturally :)
Comment #6
naudefj commentedThis module will always encode script tags to prevent XSS html injection attacks. The only way it is ever going to be allowed is if you can somehow recommend a way of making it safe to use.
PS: Last time I checked I was the maintainer, and since I don't need more info, this issue is closed.
Comment #7
boreg commentedI search the module files and found that bbcode filter alter script tags in function "function _bbcode_filter_process" on line 10 of file bbcode-filter.inc. I tried to comment the line,
#$body = preg_replace(array('#<script([^>]*)>#i', '#</script([^>]*)>#i'), array('<script\\1>', '</script\\1>'), $body);and it works, but it would be much more better to add condition based on selected settings in bbcode filter settings (/admin/settings/filters/[filternumber]/configure).
There are other filters to avoid XXS injection which are better customizable (e.g. htmlpurifier) adn cause of this logic, its not possible to use embedding e.g. twitter (uses script tag) + slideshare (uses bbcode) together on one page.
Pls understand this as suggestion for new feature to extended scalability of this great module.
Comment #9
nileshgr commentedAt the first place, why you're using bbcode to format the twitter block!?
Script tag filtering is a must.
Comment #10
boreg commentedAt the first place, why you're using bbcode to format the twitter block!?
I'm not using the bbcode to format twitter block as i mentioned in my post ;). Im using twitter (script tag) and slideshare (bbcode) portlets on one same page. So if bbcode strips SCRIPT tag, the twitter portlet is deleted. It's out of the logic - bbcode should be for formating bbcode, not for stripping other non-bbcode tags.
Comment #11
david.pache@gmail.com commentedI agree with #10.
Comment #12
benanne commentedI don't suppose this is going to make a difference since it seems that this module is no longer maintained, but I'm having the same problem right now. I'm trying to get embedded Twitter widgets working with oEmbed. The embed filter has to run before the BBCode filter, because that also processes URLs.
So this creates a catch 22: if I set the BBCode filter to run before the Embed filter, it processes all the URLs and the embed filter can no longer find them. If I set the Embed filter to run before the BBCode filter, the BBCode filter will remove the script tag in Twitter embeds.
Since the very first filter in my input format is already stripping all HTML tags, I suppose I can just do like #7 and comment this line without worrying about XSS attacks.