From 6a5eade163c87183078a524361ee7cf099d52076 Mon Sep 17 00:00:00 2001 From: garvinhicking Date: Wed, 13 Jul 2005 13:32:04 +0000 Subject: [PATCH] Fix possible XSS --- docs/NEWS | 7 ++----- include/functions_comments.inc.php | 7 +++++++ 2 files changed, 9 insertions(+), 5 deletions(-) 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']) { -- 2.39.5