• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ Contributions (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

Nickname HTML injection fix

Post a bug fix, a new feature, a theme ...

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
5 posts • Page 1 of 1

Postby teamhackaday » Mon Nov 05, 2007 4:21 pm

I don't know how many of you have come across this in your day to day operations, but there is an interesting vulnerability in the nickname command.

Normal text input is scrubbed to ensure that people do not inject their own HTML tags, such as <b>, <h1>, <blink>, etc. This ensures that no one hijacks your chat with huge text, or blinking messages, etc.

This scrubbing is not done when someone changes their nick however. This allows people to use HTML tags for their nickname, causing all sorts of havoc, especially for IE users. Give it a try in your room and see what I mean. Name yourself <marquee> and then post something. Try changing your name to <blink> or <button>, etc. - it's a huge mess.

I did some poking around and saw that in src/commands/send.class.php input is scrubbed for special characters. I checked in /src/commands/nick.class.php and saw that input was not scrubbed. I added the following line after line 32 in /src/commands/nick.class.php

Code: Select all
$newnick = phpFreeChat::FilterSpecialChar($newnick);

In case you have a different version of chat installed, for reference my line 32 read as so:

Code: Select all
$newnick = phpFreeChat::FilterNickname($param);

I suppose you could probably nest the commands as well, if you're a stickler for line count:

Code: Select all
$newnick = phpFreeChat::FilterSpecialChar(phpFreeChat::FilterNickname($param));

Either way you cut it, you should add this to your code to cover yourself.

kerphi, I hope this can make it into the next version of phpfreechat!
teamhackaday
New member
 
Posts: 4
Joined: Fri Nov 02, 2007 7:00 pm
Top

Postby ninjaw » Tue Nov 06, 2007 4:08 pm

cool work, thx
ninjaw
Member
 
Posts: 49
Joined: Thu Oct 04, 2007 10:40 pm
Top

Postby phpfreechat » Wed Nov 07, 2007 9:14 pm

teamhackaday, thank you for your detailed report.
I will correct the code in a few days, and it will available for the next version.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby teamhackaday » Thu Nov 08, 2007 4:23 pm

No problem, glad I could help.

Thanks for a great piece of software!
teamhackaday
New member
 
Posts: 4
Joined: Fri Nov 02, 2007 7:00 pm
Top

Postby phpfreechat » Sun Nov 25, 2007 8:20 pm

I fixed this issu in 1216 revision.
Thank you again for having reporting the problem.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top


Post a reply
5 posts • Page 1 of 1

Return to Contributions (v1.x)

Who is online

Users browsing this forum: No registered users and 1 guest

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub