While looking through some of the code running the new forums package,
I realized that no checks were being made to make sure the html posted
in messages would behave nicely. Last night I did some tests and sure
enough, there is no kind of html validation going on when someone
posts a new message to a forum.
In short, this means that any user can break the formatting of the
pages viewing messages. It may also mean that a user could paste
sufficient javascript, read another users cookies, and somehow pass
that info along throught some kind of link or image tag. I haven't
done sufficient testing to see if the above scenario is possible, but
I do know that javascript can read and write cookies, so it does seems
that such a hack could work.
It surprises me that such a flaw could be overlooked. A few simple
function calls and a -validate section in the content form element is
all that would be required to close this potential hole. There are
already two procs designed specifically to prevent dangerous html from
being input by users:
ad_html_security_check
util_close_html_tags
By using these procs to properly check for unwanted html, and closing
all unclosed tags, each message would be contained and would not
affect the display of other posts on the same page.