From 119ab342dc6611be5ff246479ed1bd7088a3546a Mon Sep 17 00:00:00 2001 From: Jacques Distler Date: Mon, 10 Sep 2007 22:35:50 -0500 Subject: [PATCH] Security: Sanitize Another XSS hole: the contents of ... was not being sanitized. --- lib/chunks/nowiki.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/chunks/nowiki.rb b/lib/chunks/nowiki.rb index ef99ec0b..dc1f1109 100644 --- a/lib/chunks/nowiki.rb +++ b/lib/chunks/nowiki.rb @@ -13,6 +13,10 @@ require 'chunks/chunk' # # Author: Mark Reid # Created: 8th June 2004 + +require 'sanitize' +include Sanitize + class NoWiki < Chunk::Abstract NOWIKI_PATTERN = Regexp.new('(.*?)', Regexp::MULTILINE) @@ -22,7 +26,7 @@ class NoWiki < Chunk::Abstract def initialize(match_data, content) super - @plain_text = @unmask_text = match_data[1] + @plain_text = @unmask_text = sanitize_xhtml(match_data[1]) end end