petems / tugboat

A command line tool for interacting with your DigitalOcean droplets.
MIT License
1.45k stars 89 forks source link

Cross-site Scripting (XSS) Through Unescaped JSON String in petems/tugboat (master) #270

Closed petems closed 7 years ago

petems commented 7 years ago

Cross-site Scripting (XSS) Through Unescaped JSON String in petems/tugboat (master)

Issue Details

Issue Decription

There is an XSS vulnerability in the ActiveSupport::JSON.encode method in in json/encoding.rb for Ruby on Rails. When a 'Hash' containing user-controlled data is encoded as JSON (either through 'Hash#to_json' or 'ActiveSupport::JSON.encode'), Rails does not perform adequate escaping that matches the guarantee implied by the 'escape_html_entities_in_json' option (which is enabled by default). If this resulting JSON string is subsequently inserted directly into an HTML page, the page will be vulnerable to XSS attacks.

View more details