Fix an XSS in independent_publisher_replytocom() #200

Merged
merged 1 commit into from Aug 25, 2015

Projects

None yet

2 participants

@henryk
Contributor
henryk commented Aug 24, 2015

There's a bug that enables a cross-site scripting vulnerability in independent_publisher_replytocom(). If a post page is viewed with something like ?replytocom=42<fnord/> appended to the URL the <fnord/> will be output verbatim into the resulting HTML, which could end very badly, if more evil HTML code was inserted.

The shortest fix is to just cast the ID to integer, since it's a number, and that will remove any injected code. In general though: Every time you echo in PHP, you should be absolutely certain that nothing bad can happen. There may be other instances of this in the code, I didn't look and only found this one by accident.

@raamdev raamdev merged commit faccb88 into raamdev:master Aug 25, 2015
@raamdev
Owner
raamdev commented Aug 25, 2015

@henryk Merged. Thank you! I'm not sure how I missed that one. I'm going through the whole codebase right now to see if I missed any others like this. Cheers!

@raamdev raamdev added the bug label Aug 25, 2015
@raamdev raamdev added this to the Next Release milestone Aug 25, 2015
@raamdev
Owner
raamdev commented Aug 25, 2015

I reviewed all 95 echo statements in the codebase. Everything else looks good. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment