CVE-2016-15037: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (CWE-79)
value: A vulnerability, which was classified as problematic, has been found in go4rayyan Scumblr up to 2.0.1a. Affected by this issue is some unknown functionality of the component Task Handler. The manipulation leads to cross site scripting. The attack may be launched remotely. Upgrading to version 2.0.2 is able to address this issue. The patch is identified as 5c9120f2362ddb7cbe48f2c4620715adddc4ee35. It is recommended to upgrade the affected component. VDB-251570 is the identifier assigned to this vulnerability.
CWE description: The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
CVSS v3 base score: 6.1
Published: 2024-01-21T06:15Z
Repository: https://github.com/go4rayyan/CG1
Language: Ruby
Files changed: app/views/results/metadata/_vulnerability.html.erb, app/views/task_types/_options_fields.html.erb, app/views/tasks/index.html.erb, lib/scumblr_tasks/security/python_analyzer.rb
Commit date: 2016-11-30 14:13:33 -0800
Commit message: Fixed a XSS bug (exploitable only by admins) for tasks with script tags in their name, thanks for reporting it Michael Carlson.  Also fixed a spelling mistake in the Python Analyzer reported by Kevin Hock.  Thanks!

Diff: diff --git a/app/views/results/metadata/_vulnerability.html.erb b/app/views/results/metadata/_vulnerability.html.erb
index fae23e4..a48d65f 100644
--- a/app/views/results/metadata/_vulnerability.html.erb
+++ b/app/views/results/metadata/_vulnerability.html.erb
@@ -298,11 +298,11 @@
           <td><%= vect["name"] %></td>
           <td><%= vect["payload"] %></td>
           <td><%= vect["method"] %></td>
           <td>
             <% if vect["note"].present? %>
-              <span data-tooltip aria-haspopup="true" class="has-tip tip-left" title="<%= vect["note"]%>"><i class="fi-info"></i></span></td>
+              <span data-tooltip aria-haspopup="true" class="has-tip tip-left" title="<%= h(vect["note"])%>"><i class="fi-info"></i></span></td>
           <% end %>
         </tr>
       <% end %>
     </tbody>
   </table>
diff --git a/app/views/task_types/_options_fields.html.erb b/app/views/task_types/_options_fields.html.erb
index 67f8d0e..8f6f435 100644
--- a/app/views/task_types/_options_fields.html.erb
+++ b/app/views/task_types/_options_fields.html.erb
@@ -2,11 +2,11 @@
   <% task_type_options.each do |key, value| %>
     <div class="field">
     <%= label_tag do %>
     <%= value[:name] + (value[:required] == true ? "*" : "") %>
       <% if value[:description].present? %>
-        <span data-tooltip aria-haspopup="true" class="has-tip tip-right" title="<%= value[:description] %>"><i class="fi-info"></i></span>
+        <span data-tooltip aria-haspopup="true" class="has-tip tip-right" title="<%= h(value[:description]) %>"><i class="fi-info"></i></span>
       <% end %>
     <% end %>
 
     <% if value[:type] == :boolean %>
       <%= builder.check_box key, value: builder.object[key] || value[:default] %>
diff --git a/app/views/tasks/index.html.erb b/app/views/tasks/index.html.erb
index 911db5b..2825875 100644
--- a/app/views/tasks/index.html.erb
+++ b/app/views/tasks/index.html.erb
@@ -40,11 +40,11 @@ $(function(){
           <td><%= check_box_tag "task_ids[]", task.id, false, {:class=>"result_checkbox"} %></td>
           <% status_class = task.metadata.try(:[], "_last_status").to_s.downcase %>
           <% status_class = "classification-" + status_class if status_class.present? %>
           <% if task.metadata.try(:[], "_last_status") %>
             <% message = task.metadata.try(:[], "_last_status").to_s %>
-            <% message +=  "<br/>" + task.metadata.try(:[], "_last_status_message").to_s if task.metadata.try(:[], "_last_status_message")%>
+            <% message +=  "<br/>" + h(task.metadata.try(:[], "_last_status_message").to_s) if task.metadata.try(:[], "_last_status_message") %>
             <% message += "<br/>" + link_to("Event #{task.metadata.try(:[], "_last_status_event")}", event_path(task.metadata.try(:[], "_last_status_event"))) if task.metadata.try(:[], "_last_status_event") %>
             <% message +=  "<br/>Last run: " + time_ago_in_words(DateTime.parse(task.metadata.try(:[], "_last_run").to_s)) + " ago" if task.metadata.try(:[], "_last_run")%>
             <% message +=  "<br/>Last success: " + time_ago_in_words(DateTime.parse(task.metadata.try(:[], "_last_successful_run").to_s)) + " ago" if task.metadata.try(:[], "_last_successful_run")%>
             <% if task.metadata.try(:[], "current_events").try(:[], "Error").present? %>
               <% message += search_form_for Event.search, :url=>search_events_path, :html => {:target=>'_blank'}, :method=>:post, :authenticity_token => false, id:"search_form" do |f| %>
diff --git a/lib/scumblr_tasks/security/python_analyzer.rb b/lib/scumblr_tasks/security/python_analyzer.rb
index 2ca893e..5c4c91b 100644
--- a/lib/scumblr_tasks/security/python_analyzer.rb
+++ b/lib/scumblr_tasks/security/python_analyzer.rb
@@ -43,12 +43,12 @@ class ScumblrTask::PythonAnalyzer < ScumblrTask::Async
                             required: false,
                             type: :choice,
                             default: :High,
                             choices: [:High, :Medium, :Low]
                             },
-      :severity_level => {name: "Confidence Level",
-                          description: "Confidence level to include in results",
+      :severity_level => {name: "Severity Level",
+                          description: "Severity level to include in results",
                           required: false,
                           type: :choice,
                           default: :High,
                           choices: [:High, :Medium, :Low]
                           }

Vulnerable code:               <span data-tooltip aria-haspopup="true" class="has-tip tip-left" title="<%= vect["note"]%>"><i class="fi-info"></i></span></td>
        <span data-tooltip aria-haspopup="true" class="has-tip tip-right" title="<%= value[:description] %>"><i class="fi-info"></i></span>
            <% message +=  "<br/>" + task.metadata.try(:[], "_last_status_message").to_s if task.metadata.try(:[], "_last_status_message")%>
      :severity_level => {name: "Confidence Level",
                          description: "Confidence level to include in results",
Fixed code:               <span data-tooltip aria-haspopup="true" class="has-tip tip-left" title="<%= h(vect["note"])%>"><i class="fi-info"></i></span></td>
        <span data-tooltip aria-haspopup="true" class="has-tip tip-right" title="<%= h(value[:description]) %>"><i class="fi-info"></i></span>
            <% message +=  "<br/>" + h(task.metadata.try(:[], "_last_status_message").to_s) if task.metadata.try(:[], "_last_status_message") %>
      :severity_level => {name: "Severity Level",
                          description: "Severity level to include in results",