]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4269 Use html_escape function on some variables to prevent XSS
authorJulien Lancelot <julien.lancelot@gmail.com>
Mon, 12 Aug 2013 12:42:12 +0000 (14:42 +0200)
committerJulien Lancelot <julien.lancelot@gmail.com>
Mon, 12 Aug 2013 12:42:12 +0000 (14:42 +0200)
sonar-server/src/main/webapp/WEB-INF/app/views/dependencies/index.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/groups/index.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/groups/select_user.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/gwt/_base.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/layouts/_layout.html.erb
sonar-server/src/main/webapp/WEB-INF/app/views/resource/_options.html.erb

index 9369185a671584f9e178ee2f15c7a76530d61cb4..195facdec93efcd0197f5c9b7b0296accdbd7064 100644 (file)
@@ -26,7 +26,7 @@ padding: 5px;
 </style>
 <% end %>
 <form action="<%= ApplicationController.root_context -%>/dependencies/index" id="search_form">
-  <input type="text" name="search" value="<%= params[:search] -%>" id="search_input"> </input>
+  <input type="text" name="search" value="<%= params[:search] -%>" id="search_input"> </input>
   <input type="submit" value="<%= message('dependencies.search_library') -%>" id="search_submit"/><br/>
   <p class="small gray"><%= message('dependencies.search_help') -%></p>
 </form>
index 7084251ccd03ccc9025af5cae3e2e1d06375003d..61351fdc1b5b8194caefae25313b31948f1b17c7 100644 (file)
@@ -15,8 +15,8 @@
         <tbody >
         <% @groups.each do |group|%>
           <tr id="group-<%= u group.name -%>">
-            <td class="left"><%= group.name %></td>
-            <td class="left" style="word-break:break-all"><%=group.description%></td>
+            <td class="left"><%= group.name %></td>
+            <td class="left" style="word-break:break-all"><%= h group.description%></td>
             <td class="left">
               <span id="count-<%= u group.name -%>"><%= group.users.count %></span> (<%= link_to "select", { :action => 'select_user', :id => group.id}, {:id => "select-#{u group.name}", :class => 'link-action'} %>)
             </td>
index cb72424925819b2b76acea10787b6c29182b0bbc..d3835282522ca95d1a0b83486f56da281354d2d9 100644 (file)
@@ -12,7 +12,7 @@
             <h2>Non-members</h2>
             <select name="from" id="from" size="30" style="margin: 5px 0pt; width: 300px;" multiple="multiple">
               <% @group.available_users.sort.each do |user| %>
-                <option value="<%= user.id -%>"><%= user.name -%></option>
+                <option value="<%= user.id -%>"><%= user.name -%></option>
               <% end %>
             </select>
           </td>
index 4ed503320070c6cb393a03b331b34dd9ff9bcd4f..14b862a081c04aaa5aae624d4876631cc0f6d92e 100644 (file)
@@ -20,7 +20,7 @@
       index=0
       params.each do |key,value|
     %>
-    <%= ',' if index>0 -%>"<%= key -%>":"<%= h(value) -%>"
+    <%= ',' if index>0 -%>"<%= h(key) -%>":"<%= h(value) -%>"
     <%
         index+=1
       end
index 1fad73248e2f0f70a1d5869be7019e4cf97ebd6f..363c276bb1724cf5438aea08feaf709cece17008 100644 (file)
@@ -4,7 +4,7 @@
      selected_section = Navigation::SECTION_HOME
    end
    @project=@resource unless @project || selected_section==Navigation::SECTION_HOME
-   period_param = "period=#{params[:period]}" if params[:period]
+   period_param = "period=#{h(params[:period])}" if params[:period]
 %>
 <div id="container">
   <%= yield :header -%>
index 5047c094f36fa5f49b0b2d4c3f39c415b08b52fe..09f817ea2e00ac075dd6a60daaf7f1b73c3c8e19 100644 (file)
@@ -7,15 +7,15 @@
       applyOptions = function (elt) {
         var currentForm = $j(elt).closest('.options-form');
         var params = currentForm.serialize();
-        var url = '<%= ApplicationController.root_context -%>/resource/index/<%= @resource.key %>?display_title=<%= params[:display_title].to_s -%>&'+ params;
+        var url = '<%= ApplicationController.root_context -%>/resource/index/<%= h @resource.key %>?display_title=<%= h params[:display_title].to_s -%>&'+ params;
         openAccordionItem(url, elt, true);
         return true;
       };
     </script>
     <form method="GET" action="<%= url_for :controller => 'resource', :action => 'index', :id => @resource.key -%>" class="options-form">
-      <input type="hidden" name="tab" value="<%= params[:tab] -%>"/>
-      <input type="hidden" name="metric" value="<%= params[:metric] -%>"/>
-      <input type="hidden" name="period" value="<%= params[:period] -%>"/>
+      <input type="hidden" name="tab" value="<%= params[:tab] -%>"/>
+      <input type="hidden" name="metric" value="<%= params[:metric] -%>"/>
+      <input type="hidden" name="period" value="<%= params[:period] -%>"/>
 
       <table>
         <tr>