XSS Mod in 2.0.17 Breaks My URL Tags

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Gadget Wizard
Registered User
Posts: 21
Joined: Tue Jun 07, 2005 1:33 pm

XSS Mod in 2.0.17 Breaks My URL Tags

Post by Gadget Wizard »

Some of my forum members use colors in the URL tag like so

[url=http://news.com/][color=green]Click here ...[/color][/url]

After applying the code changes to fix the XSS issue, this no longer works.

Is this an intended affect or is there something else afoot?

tia
Gadget Wizard
Image
Graham
Former Team Member
Posts: 8462
Joined: Tue Mar 19, 2002 7:11 pm
Location: UK
Contact:

Post by Graham »

That's deliberate. Put the colour outside the url and it will work
"So Long, and Thanks for All the Fish"

phpBB Useful Links: Knowledge Base | Userguide | Forum Search | MOD Database | Styles Database
My Links: Blog!
Gadget Wizard
Registered User
Posts: 21
Joined: Tue Jun 07, 2005 1:33 pm

Post by Gadget Wizard »

Thanks for the quik reply.

I figured that was the case. I guess this means all the URL tags constructed this way will no longer function.

eeek!!
Gadget Wizard
Image
Gadget Wizard
Registered User
Posts: 21
Joined: Tue Jun 07, 2005 1:33 pm

Post by Gadget Wizard »

After looking at my board, a huge number of links are going to be broken if I install the code changes to fix the XSS issue.

Is this a major security issue?

If so, is there another way to plug the hole without breaking all my links?
Gadget Wizard
Image
Graham
Former Team Member
Posts: 8462
Joined: Tue Mar 19, 2002 7:11 pm
Location: UK
Contact:

Post by Graham »

Let me look into it. Looking at this again when I'm slightly more awake that is not deliberate (Note to self: don't comment on code when you've just got up ;) ). I'd misread where the bracket was.
"So Long, and Thanks for All the Fish"

phpBB Useful Links: Knowledge Base | Userguide | Forum Search | MOD Database | Styles Database
My Links: Blog!
Graham
Former Team Member
Posts: 8462
Joined: Tue Mar 19, 2002 7:11 pm
Location: UK
Contact:

Post by Graham »

OK, I've checked and it does work fine

eg
Click here ...

Can you please try the following:
[*] Take a backup of bbcode.php on your forum
[*] Replace with a copy from a new download of 2.0.17
"So Long, and Thanks for All the Fish"

phpBB Useful Links: Knowledge Base | Userguide | Forum Search | MOD Database | Styles Database
My Links: Blog!
Gadget Wizard
Registered User
Posts: 21
Joined: Tue Jun 07, 2005 1:33 pm

Post by Gadget Wizard »

Ok, thanks for the help Graham. I just added the XSS code changes to my bbcode.php module rather than replace the module because I have a heavily modded board.

I see now that your example does indeed work. I guess I should have tried it here myself before asking.

I guess there is something else afoot afterall.

I'll try to compare the two modules and see if I can fix it!!

Thanks again!!
Gadget Wizard
Image
oktracer
Registered User
Posts: 27
Joined: Sun Feb 29, 2004 6:27 am

Post by oktracer »

I have a smilar issue with url tags in img tags.

Code: Select all

[url=http://www.aimutation.com/links.php?action=go&link_id=6][img]http://www.aimutation.com/images/tracesig.gif[/img][/url]
Now displays as this
Image
Graham
Former Team Member
Posts: 8462
Joined: Tue Mar 19, 2002 7:11 pm
Location: UK
Contact:

Post by Graham »

That one is a template issue. Make sure that the image and url replacements in bbcode.tpl are on the same line, or ask in the topic for that style
"So Long, and Thanks for All the Fish"

phpBB Useful Links: Knowledge Base | Userguide | Forum Search | MOD Database | Styles Database
My Links: Blog!
oktracer
Registered User
Posts: 27
Joined: Sun Feb 29, 2004 6:27 am

Post by oktracer »

Have the same issue on all templates including the default subsilver. This didn't appear until after the 2.0.17 update.
Gadget Wizard
Registered User
Posts: 21
Joined: Tue Jun 07, 2005 1:33 pm

Post by Gadget Wizard »

Graham wrote: Can you please try the following:
[*] Take a backup of bbcode.php on your forum
[*] Replace with a copy from a new download of 2.0.17


I copied over the current bbcode.php just to see if that would correct my URL tag problem but it didn't.

This tells me that I have an issue somewhere else.

Here is what I see.

Code: Select all

[url=http://news.com/][color=green]Click here ...[/color][/url]
produces this

Image

Any suggestions on anywhere else I might look to correct this problem?

Thanks!!
Gadget Wizard
Image
Graham
Former Team Member
Posts: 8462
Joined: Tue Mar 19, 2002 7:11 pm
Location: UK
Contact:

Post by Graham »

OK, what template are you using?

Can you post the contents of bbcode.tpl from it, I suspect the issue will be in there.
"So Long, and Thanks for All the Fish"

phpBB Useful Links: Knowledge Base | Userguide | Forum Search | MOD Database | Styles Database
My Links: Blog!
_daemon_
Registered User
Posts: 6
Joined: Fri Jun 24, 2005 6:59 am
Location: Greece
Contact:

Post by _daemon_ »

i have an issue with img tags probably because of the changes @ bbcode.php
when i try to preview a post the [img] tags dont display the picture but something like [img:20cb8ff15f]http://www.kanet.com/outlaw/outlaw-Ujin4.gif[/img:20cb8ff15f][img:20cb8ff15f]http://www.kanet.com/outlaw/cool.gif[/img:20cb8ff15f]
anyone knows what exactly causes this and if it can be fixed?
When i submit the post everything is ok. thanks
Gadget Wizard
Registered User
Posts: 21
Joined: Tue Jun 07, 2005 1:33 pm

Post by Gadget Wizard »

Graham wrote: OK, what template are you using?

Can you post the contents of bbcode.tpl from it, I suspect the issue will be in there.


I'm using a heavily modded phpXP2 template.

Code: Select all

<!-- BEGIN color_open -->
<span style="color: {COLOR}">
<!-- END color_open -->
<!-- BEGIN color_close -->
</span>
<!-- END color_close -->
Last edited by Gadget Wizard on Thu Jul 21, 2005 7:43 am, edited 1 time in total.
Gadget Wizard
Image
Graham
Former Team Member
Posts: 8462
Joined: Tue Mar 19, 2002 7:11 pm
Location: UK
Contact:

Post by Graham »

Yes, that looks to be the problem, the start of the replacement in there should be on the same line as the BEGIN and the end of it on the same line as the END.

eg

Code: Select all

<!-- BEGIN color_open --><span style="color: {COLOR}"><!-- END color_open -->
<!-- BEGIN color_close --></span><!-- END color_close -->
"So Long, and Thanks for All the Fish"

phpBB Useful Links: Knowledge Base | Userguide | Forum Search | MOD Database | Styles Database
My Links: Blog!
Locked

Return to “2.0.x Support Forum”