0

In a rails 5.2.3 erb template:

<% input = "<script>alert('XSS')</script>" %>
<p><%= input %></p>

is showing <script>alert('XSS')</script> instead of &gt.. etc

Isn't <%= ... %> supposed to prevent against reflected xss attack? Same issue if input is retrieved from params[:input]

The raw is output in the html:

enter image description here

rigyt
  • 2,219
  • 3
  • 28
  • 40

1 Answers1

0

Need to look in source ctrl+u as Gabor suggested

rigyt
  • 2,219
  • 3
  • 28
  • 40