Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Introduce notion of 'html_safe?' to Strings in preparation for on-by-default XSS

#3018

As discussed on the core-list

http://groups.google.com/group/rubyonrails-core/browse_thread/threa...

I've attached the patch I intend to roll-in to 2-3-stable. I'm creating this ticket to give a chance for others to test and object / comment.

  • Strings are marked safe with String#html_safe!
  • SafeBuffer is a new buffer class which escapes all non-safe strings
  • Add a raw helper which marks strings as safe

Note, this change does not impact rendering in any way, you must install the rails_xss plugin to get that behaviour.

Reported by Michael Koziarski · August 9th, 2009 @ 01:19 AM

State: resolved
Milestone: 2.3.6
Assigned to: Michael Koziarski Michael Koziarski
Importance: Low

Activity

  1. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.3.4 to 2.3.6

    [milestone:id#50064 bulk edit command]

    September 11th, 2009 @ 11:04 PM

  2. Bruno Michel
    Bruno Michel

    The button_to helper does not return a string marked as safe. I've made a small patch to fix it.

    October 10th, 2009 @ 11:40 PM

  3. Bruno Michel
    Bruno Michel

    Please apply this patch. The button_to helper is broken on rails 2.3 when using the rails_xss plugin (but the parenthesis are there in Rails 3).

    October 19th, 2009 @ 12:47 AM

  4. Bruno Michel
    Bruno Michel

    I was advised to create a new ticket for this bug to help tracking the status on. So, it is #3448 Button_to does not return an HTML-safe string.

    November 1st, 2009 @ 12:47 PM

  5. Lenary
    Lenary

    just a question, it looks like this has been applied. has it really?

    April 22nd, 2010 @ 09:38 PM

  6. Rizwan Reza
    Rizwan Reza
    • State changed from new to resolved

    May 16th, 2010 @ 02:39 AM

  7. Ryan Bigg
    Ryan Bigg
    • Importance changed from to Low

    Automatic cleanup of spam.

    October 9th, 2010 @ 09:56 PM

  8. bingbing