Ruby on Rails Translate Helper Method Cross-Site Scripting Vulnerability

Source: Internet
Author: User
Tags ruby on rails

Release date: 2011-11-17
Updated on: 2011-11-21

Affected Systems:
Ruby on Rails 3.x
Unaffected system:
Ruby on Rails 3.1.2
Ruby on Rails 3.0.11
Description:
--------------------------------------------------------------------------------
Bugtraq id: 50722

Ruby on Rails (RoR or Rails) is an open-source Web application framework written in Ruby. It is developed in strict accordance with the MVC structure.

Ruby on Rails has a security vulnerability in the implementation of the Translate Helper method. Remote attackers can exploit this vulnerability to execute arbitrary script code in the user's browser of the affected site to steal Cookie authentication creden.

The Translate Helper method regards the name of the translation string ending with html as HTML security and has the insertion mechanism. These html strings can contain any value in the tampered input and cannot be escaped.

<* Source: Sergey Nartimov

Link: http://groups.google.com/group/rubyonrails-security/browse_thread/thread/2b61d70fb73c7cc5? Pli = 1
*>

Suggestion:
--------------------------------------------------------------------------------
Temporary solution:

Manually escape all tampered input, for example:

Translate ('some _ html ',: some =>' <input> ')
Should be changed:
Translate ('some _ html ',: some => h (' <input> '))

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.