From: garvinhicking Date: Wed, 13 Jul 2005 13:32:04 +0000 (+0000) Subject: Fix possible XSS X-Git-Tag: 0.8.3~36 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=6a5eade163c87183078a524361ee7cf099d52076;p=s9y.git Fix possible XSS --- diff --git a/docs/NEWS b/docs/NEWS index 5701e1c..e0eadcf 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,11 +3,8 @@ Version 0.8.3 () ------------------------------------------------------------------------ - * XML_RPC: Eliminate path disclosure vulnerabilities by suppressing - error messages when eval()'ing. Eliminate path disclosure - vulnerability by catching bogus parameters submitted - to XML_RPC_Value::serializeval(). (nohn) - + * Fixed possible XSS in comment input validation, thanks to + Ilia Alshanetsky Version 0.8.2 (June 29th, 2005) ------------------------------------------------------------------------ diff --git a/include/functions_comments.inc.php b/include/functions_comments.inc.php index 027f956..6213094 100644 --- a/include/functions_comments.inc.php +++ b/include/functions_comments.inc.php @@ -177,6 +177,13 @@ function serendipity_printComments($comments, $parentid = 0, $depth = 0, $trace $comment['url'] = 'http://' . $comment['url']; } + if (!empty($comment['url'])) { + if (!@parse_url($comment['url'])) { + $comment['url'] = ''; + } + $comment['url'] = htmlspecialchars($comment['url'], ENT_QUOTES); + } + serendipity_plugin_api::hook_event('frontend_display', $comment); if (isset($comment['no_email']) && $comment['no_email']) {