Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 712961 Details for
Bug 921331
CVE-2013-1855 rubygem-actionpack: css_sanitization: XSS vulnerability in sanitize_css
Home
New
Search
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh92 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
[?]
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
3-0-css_sanitize.patch
3-0-css_sanitize.patch (text/plain), 2.41 KB, created by
Kurt Seifried
on 2013-03-19 20:59:00 UTC
(
hide
)
Description:
3-0-css_sanitize.patch
Filename:
MIME Type:
Creator:
Kurt Seifried
Created:
2013-03-19 20:59:00 UTC
Size:
2.41 KB
patch
obsolete
>From 54ae510e62b71104f1407d2de78d2ab142e0d1aa Mon Sep 17 00:00:00 2001 >From: Charlie Somerville <charlie@charliesomerville.com> >Date: Wed, 13 Feb 2013 09:09:53 +1100 >Subject: [PATCH] fix incorrect ^$ usage leading to XSS in sanitize_css > >--- > .../lib/action_controller/vendor/html-scanner/html/sanitizer.rb | 6 +++--- > actionpack/test/template/html-scanner/sanitizer_test.rb | 5 +++++ > 2 files changed, 8 insertions(+), 3 deletions(-) > >diff --git a/actionpack/lib/action_controller/vendor/html-scanner/html/sanitizer.rb b/actionpack/lib/action_controller/vendor/html-scanner/html/sanitizer.rb >index dceddb9..6cf4d27 100644 >--- a/actionpack/lib/action_controller/vendor/html-scanner/html/sanitizer.rb >+++ b/actionpack/lib/action_controller/vendor/html-scanner/html/sanitizer.rb >@@ -109,8 +109,8 @@ module HTML > style = style.to_s.gsub(/url\s*\(\s*[^\s)]+?\s*\)\s*/, ' ') > > # gauntlet >- if style !~ /^([:,;#%.\sa-zA-Z0-9!]|\w-\w|\'[\s\w]+\'|\"[\s\w]+\"|\([\d,\s]+\))*$/ || >- style !~ /^(\s*[-\w]+\s*:\s*[^:;]*(;|$)\s*)*$/ >+ if style !~ /\A([:,;#%.\sa-zA-Z0-9!]|\w-\w|\'[\s\w]+\'|\"[\s\w]+\"|\([\d,\s]+\))*\z/ || >+ style !~ /\A(\s*[-\w]+\s*:\s*[^:;]*(;|$)\s*)*\z/ > return '' > end > >@@ -121,7 +121,7 @@ module HTML > elsif shorthand_css_properties.include?(prop.split('-')[0].downcase) > unless val.split().any? do |keyword| > !allowed_css_keywords.include?(keyword) && >- keyword !~ /^(#[0-9a-f]+|rgb\(\d+%?,\d*%?,?\d*%?\)?|\d{0,2}\.?\d{0,2}(cm|em|ex|in|mm|pc|pt|px|%|,|\))?)$/ >+ keyword !~ /\A(#[0-9a-f]+|rgb\(\d+%?,\d*%?,?\d*%?\)?|\d{0,2}\.?\d{0,2}(cm|em|ex|in|mm|pc|pt|px|%|,|\))?)\z/ > end > clean << prop + ': ' + val + ';' > end >diff --git a/actionpack/test/template/html-scanner/sanitizer_test.rb b/actionpack/test/template/html-scanner/sanitizer_test.rb >index 889a0f7..d9853e8 100644 >--- a/actionpack/test/template/html-scanner/sanitizer_test.rb >+++ b/actionpack/test/template/html-scanner/sanitizer_test.rb >@@ -248,6 +248,11 @@ class SanitizerTest < ActionController::TestCase > assert_equal '', sanitize_css(raw) > end > >+ def test_should_sanitize_across_newlines >+ raw = %(\nwidth:\nexpression(alert('XSS'));\n) >+ assert_equal '', sanitize_css(raw) >+ end >+ > def test_should_sanitize_img_vbscript > assert_sanitized %(<img src='vbscript:msgbox("XSS")' />), '<img />' > end >-- >1.8.1.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 921331
:
712960
| 712961 |
712962
|
712963