sstephenson / eco

Embedded CoffeeScript templates
MIT License
1.71k stars 70 forks source link

Security issue #67

Open cantino opened 10 years ago

cantino commented 10 years ago

Eco's default __escape implementation doesn't escape single quotes, which makes XSS attacks like the following possible:

<input type='text' value='<%= @value %>'>

with a @value of x'onmouseover='alert(document.domain), an XSS occurs.

This fork fixes the issue by using Underscore's escape.