Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix an XSS in independent_publisher_replytocom() #200

Merged
merged 1 commit into from
Aug 25, 2015

Conversation

henryk
Copy link
Contributor

@henryk 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
Copy link
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
Copy link
Owner

raamdev commented Aug 25, 2015

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

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants