MyBB Hacks

Full Version: Easy MyCodes
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
If you take a look around, for example, the MyCodes forum at MyBB community, you'll probably notice a number of MyCodes posted there using the "(.*?)" expression. (note, previous statement is true at time of writing)

This particular expression allows almost any input to be placed by the user, which can be dangerous in certain circumstances by potentially allowing various injections.  This is perhaps due to the fact that many such "MyCode developers" really don't know how to properly use regular expressions.

This plugin aims to make it easier for administrators to write properly sanitised MyCodes which aren't vulnerable to such injections.  Instead of writing custom MyCodes in regular expression form, you just enter what you want and place appropriate tokens in the expression.
Furthermore, you can actually still use regular expressions in custom MyCodes, so no functionality is actually lost using this plugin (regular expressions need to be escaped however; more information is supplied in the AdminCP when adding/editing MyCodes).



To demonstrate an example of an injection, this is what an innocent looking MyCode for allowing custom background colours, might look like:
Expression: \[bg=(.*?)\](.*?)\[/bg\]
Replacement: <span style="background-color: $1;">$2</span>

Perhaps it looks okay, until a user enters something like this in their post:

Code:
[bg=red; display: block; position: absolute; top: 0; left: 0; width: 100%; height: 1000%; font-size: 144pt]hahahahahaha[/bg]


Using Easy MyCodes, the admin would use the following instead:
Expression: [bg={COLOR}]{ANYTHING}[/bg]
Replacement: <span style="background-color: $1;">$2</span>
And prevent the injection at the same time.

Oh great. This is very useful. Thank you very much, Yumi.
Thanks Rateu Smile
cool Smile
this is incompatible with some plugins and also giving memory exhausted errors. if anyone gets into trouble while using this, try deactivating it and check for the errors.
As far as I know, I didn't faced any error while using it. I assume you have any other plugin that might interfere with it.
yeah, shoutbox is one which is interfering. as a suggestion i said to deactivate it, because people may think its the error in shoutbox though easycode is cause for it.
It maybe because shoutbox allows use of mycodes? Try turning that option off.
Which shoutbox is it?
pirato nervo's, it shows on loading while easy code is activated. but disabling it, fixed it.
Pages: 1 2 3
Reference URL's