View Issue Details

IDProjectCategoryView StatusLast Update
0000149XMB1Bugspublic2008-11-16 19:38
Reportermiqrogroove Assigned Tomiqrogroove  
PriorityhighSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version1.9.8 SP2 
Target Version1.9.11Fixed in Version1.9.11 
Summary0000149: I/O Failure in [size] BBCode
DescriptionPost.php does not pass our standard I/O test if wrapped in [size] BBCode tags. This leads to a trivial bypass of the entire censor system as well as cosmetic slashing problems.
Steps To Reproduce[size=5]
{1; 2' 3" 4< 5> 6& 7$db++;}
{1+ 2# 3% 4& 5= 6: 7/ 8?}
{1\ 2\\ 3\\\ 4\\\\}
{'-- hitshitshits misspellled 12345}
{1[b]bold[/b] 2:) 3<body> 4[*]test 5javaScript:alert(1); 6!--}
[/size]
TagsNo tags attached.
MySQL Version
PHP Version
Web Server
Browser
Flags
Original Reporter
SVN Revision1355

Activities

miqrogroove

2008-08-31 02:43

administrator   ~0000055

Don't be fooled by the ugly replacement string. It is actually the pattern string that is at fault here. The pattern is crap.

In order to call createAbsFSizeFromRel in the middle of the pattern it would be necessary to use preg_replace_callback() to pre-parse all the [size] tags, and then use a simplified pattern for the HTML replacement. Again, this seems like a crap strategy.

Notice function createAbsFSizeFromRel() is never used anywhere other than in the BBCode parser.

Let's take the [size] tag out of the preg_replace() arrays entirely, and set it up with a straight preg_replace_callback($new_pattern, 'createAbsFSizeFromRel', $message); The argument for the callback function changes from $rel to $matches, and the function returns raw HTML. To make it look pretty, change the callback function's name to something like bbcodeSizeTags().

Issue History

Date Modified Username Field Change
2008-08-31 00:32 miqrogroove New Issue
2008-08-31 00:32 miqrogroove Steps to Reproduce Updated
2008-08-31 02:43 miqrogroove Note Added: 0000055
2008-11-13 14:37 miqrogroove Assigned To => miqrogroove
2008-11-13 14:37 miqrogroove Status new => assigned
2008-11-13 14:37 miqrogroove Projection none => minor fix
2008-11-13 14:37 miqrogroove Steps to Reproduce Updated
2008-11-13 15:11 miqrogroove SVN Revision => 1355
2008-11-13 15:11 miqrogroove Status assigned => resolved
2008-11-13 15:11 miqrogroove Fixed in Version => 1.9.11
2008-11-13 15:11 miqrogroove Resolution open => fixed
2008-11-16 19:38 miqrogroove Status resolved => closed