Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 211294 Details for
Bug 294797
<dev-ruby/rails-2.3.5 XSS weakness in strip_tags (CVE-2009-4214)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for Rails 2.2.x
2-2-strip_tags.patch (text/plain), 2.04 KB, created by
Hans de Graaff
on 2009-11-27 07:56:55 UTC
(
hide
)
Description:
Patch for Rails 2.2.x
Filename:
MIME Type:
Creator:
Hans de Graaff
Created:
2009-11-27 07:56:55 UTC
Size:
2.04 KB
patch
obsolete
>From 785281ade8c2347614525e9aceb5e62c80eec6f8 Mon Sep 17 00:00:00 2001 >From: Gabe da Silveira <gabe@websaviour.com> >Date: Mon, 16 Nov 2009 21:17:35 -0800 >Subject: [PATCH] Make sure strip_tags removes tags which start with a non-printable character > >Signed-off-by: Michael Koziarski <michael@koziarski.com> >--- > .../vendor/html-scanner/html/node.rb | 2 +- > .../test/controller/html-scanner/sanitizer_test.rb | 1 + > 2 files changed, 2 insertions(+), 1 deletions(-) > >diff --git a/actionpack/lib/action_controller/vendor/html-scanner/html/node.rb b/actionpack/lib/action_controller/vendor/html-scanner/html/node.rb >index 6c03316..0cd05d8 100644 >--- a/actionpack/lib/action_controller/vendor/html-scanner/html/node.rb >+++ b/actionpack/lib/action_controller/vendor/html-scanner/html/node.rb >@@ -162,7 +162,7 @@ module HTML #:nodoc: > end > > closing = ( scanner.scan(/\//) ? :close : nil ) >- return Text.new(parent, line, pos, content) unless name = scanner.scan(/[\w:-]+/) >+ return Text.new(parent, line, pos, content) unless name = scanner.scan(/[-:\w\x00-\x09\x0b-\x0c\x0e-\x1f]+/) > name.downcase! > > unless closing >diff --git a/actionpack/test/controller/html-scanner/sanitizer_test.rb b/actionpack/test/controller/html-scanner/sanitizer_test.rb >index bae0f5c..51baba6 100644 >--- a/actionpack/test/controller/html-scanner/sanitizer_test.rb >+++ b/actionpack/test/controller/html-scanner/sanitizer_test.rb >@@ -19,6 +19,7 @@ class SanitizerTest < Test::Unit::TestCase > assert_equal "This has a here.", sanitizer.sanitize("This has a <!-- comment --> here.") > assert_equal "This has a here.", sanitizer.sanitize("This has a <![CDATA[<section>]]> here.") > assert_equal "This has an unclosed ", sanitizer.sanitize("This has an unclosed <![CDATA[<section>]] here...") >+ assert_equal "non printable char is a tag", sanitizer.sanitize("<\x07a href='/hello'>non printable char is a tag</a>") > [nil, '', ' '].each { |blank| assert_equal blank, sanitizer.sanitize(blank) } > end > >-- >1.6.0.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 294797
: 211294 |
211295