CVE-2022-4588: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (CWE-79)
value: A vulnerability, which was classified as problematic, was found in Boston Sleep slice up to 84.1.x. Affected is an unknown function of the component Layout Handler. The manipulation leads to cross site scripting. It is possible to launch the attack remotely. Upgrading to version 84.2.0 is able to address this issue. The name of the patch is 6523bb17d889e2ab13d767f38afefdb37083f1d0. It is recommended to upgrade the affected component. VDB-216174 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: 2022-12-17T13:15Z
Repository: https://github.com/sleepepi/slice
Language: Other
Files changed: CHANGELOG.md, app/views/layouts/application.html.haml, app/views/layouts/full_page.html.haml, app/views/layouts/full_page_sidebar.html.haml, app/views/layouts/full_page_sidebar_dark.html.haml
Commit date: 2022-04-23 13:56:25 -0400
Commit message: Fixed a Cross Site Scripting (XSS) issue

Diff: diff --git a/CHANGELOG.md b/CHANGELOG.md
index ca30f6556..d6ea73bc5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,7 +1,11 @@
 ## 84.2.0
 
+### Enhancements
+- **Security Changes**
+  - Fixed a Cross Site Scripting (XSS) issue
+
 ## 84.1.0 (August 7, 2021)
 
 ### Enhancements
 - **Project Changes**
   - Recent activity now shows activity for the past month
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
index b7f20b9b1..c30ad3b68 100644
--- a/app/views/layouts/application.html.haml
+++ b/app/views/layouts/application.html.haml
@@ -9,11 +9,11 @@
     = render "layouts/meta/facebook"
     = render "layouts/meta/google"
     = render "layouts/meta/apple"
     -# Don't cache any pages
     %meta{ name: "turbolinks-cache-control", content: "no-cache" }
-    %title= [@title, @subject.try(:subject_code_was), @project.try(:name), ENV["website_name"]].flatten.compact.uniq.join(" - ").html_safe
+    %title= [@title, @subject.try(:subject_code_was), @project.try(:name), ENV["website_name"]].flatten.compact.uniq.join(" - ")
     = render "layouts/meta/favicon"
     = csrf_meta_tags
     = stylesheet_link_tag "application", media: "all", data: { turbolinks_track: "reload" }
     = javascript_include_tag "application", data: { turbolinks_track: "reload" }
     = javascript_tag "var root_url=\"#{request.script_name + "/"}\";"
diff --git a/app/views/layouts/full_page.html.haml b/app/views/layouts/full_page.html.haml
index 6065bd149..28db55d7d 100644
--- a/app/views/layouts/full_page.html.haml
+++ b/app/views/layouts/full_page.html.haml
@@ -8,11 +8,11 @@
     = render "layouts/meta/facebook"
     = render "layouts/meta/google"
     = render "layouts/meta/apple"
     -# Don't cache any pages
     %meta{ name: "turbolinks-cache-control", content: "no-cache" }
-    %title= [@title, @subject.try(:subject_code_was), @project.try(:name), ENV["website_name"]].flatten.compact.uniq.join(" - ").html_safe
+    %title= [@title, @subject.try(:subject_code_was), @project.try(:name), ENV["website_name"]].flatten.compact.uniq.join(" - ")
     = render "layouts/meta/favicon"
     = csrf_meta_tags
     = stylesheet_link_tag "application", media: "all", data: { turbolinks_track: "reload" }
     = javascript_include_tag "application", data: { turbolinks_track: "reload" }
     = javascript_tag "var root_url=\"#{request.script_name + "/"}\";"
diff --git a/app/views/layouts/full_page_sidebar.html.haml b/app/views/layouts/full_page_sidebar.html.haml
index b661f25cc..1d408e10b 100644
--- a/app/views/layouts/full_page_sidebar.html.haml
+++ b/app/views/layouts/full_page_sidebar.html.haml
@@ -9,11 +9,11 @@
     = render "layouts/meta/facebook"
     = render "layouts/meta/google"
     = render "layouts/meta/apple"
     -# Don't cache any pages
     %meta{ name: "turbolinks-cache-control", content: "no-cache" }
-    %title= [@title, @subject.try(:subject_code_was), @project.try(:name), ENV["website_name"]].flatten.compact.uniq.join(" - ").html_safe
+    %title= [@title, @subject.try(:subject_code_was), @project.try(:name), ENV["website_name"]].flatten.compact.uniq.join(" - ")
     = render "layouts/meta/favicon"
     = csrf_meta_tags
     = stylesheet_link_tag "application", media: "all", data: { turbolinks_track: "reload" }
     = javascript_include_tag "application", data: { turbolinks_track: "reload" }
     = javascript_tag "var root_url=\"#{request.script_name + "/"}\";"
diff --git a/app/views/layouts/full_page_sidebar_dark.html.haml b/app/views/layouts/full_page_sidebar_dark.html.haml
index d60f1671f..f558f1dcb 100644
--- a/app/views/layouts/full_page_sidebar_dark.html.haml
+++ b/app/views/layouts/full_page_sidebar_dark.html.haml
@@ -9,11 +9,11 @@
     = render "layouts/meta/facebook"
     = render "layouts/meta/google"
     = render "layouts/meta/apple"
     -# Don't cache any pages
     %meta{ name: "turbolinks-cache-control", content: "no-cache" }
-    %title= [@title, @subject.try(:subject_code_was), @project.try(:name), ENV["website_name"]].flatten.compact.uniq.join(" - ").html_safe
+    %title= [@title, @subject.try(:subject_code_was), @project.try(:name), ENV["website_name"]].flatten.compact.uniq.join(" - ")
     = render "layouts/meta/favicon"
     = csrf_meta_tags
     = stylesheet_link_tag "application", media: "all", data: { turbolinks_track: "reload" }
     = javascript_include_tag "application", data: { turbolinks_track: "reload" }
     = javascript_tag "var root_url=\"#{request.script_name + "/"}\";"

Vulnerable code:     %title= [@title, @subject.try(:subject_code_was), @project.try(:name), ENV["website_name"]].flatten.compact.uniq.join(" - ").html_safe
    %title= [@title, @subject.try(:subject_code_was), @project.try(:name), ENV["website_name"]].flatten.compact.uniq.join(" - ").html_safe
    %title= [@title, @subject.try(:subject_code_was), @project.try(:name), ENV["website_name"]].flatten.compact.uniq.join(" - ").html_safe
    %title= [@title, @subject.try(:subject_code_was), @project.try(:name), ENV["website_name"]].flatten.compact.uniq.join(" - ").html_safe
Fixed code: ### Enhancements
- **Security Changes**
  - Fixed a Cross Site Scripting (XSS) issue

    %title= [@title, @subject.try(:subject_code_was), @project.try(:name), ENV["website_name"]].flatten.compact.uniq.join(" - ")
    %title= [@title, @subject.try(:subject_code_was), @project.try(:name), ENV["website_name"]].flatten.compact.uniq.join(" - ")
    %title= [@title, @subject.try(:subject_code_was), @project.try(:name), ENV["website_name"]].flatten.compact.uniq.join(" - ")
    %title= [@title, @subject.try(:subject_code_was), @project.try(:name), ENV["website_name"]].flatten.compact.uniq.join(" - ")