OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Add spec to ensure user-provided HTML is escaped when rendered
Aaron Contreras6463d44f39be
diff --git a/modules/meeting/spec/features/meetings_index_spec.rb b/modules/meeting/spec/features/meetings_index_spec.rbindex 6350bae9d0d..2dd6d3ff270 100644--- a/modules/meeting/spec/features/meetings_index_spec.rb+++ b/modules/meeting/spec/features/meetings_index_spec.rb@@ -55,6 +55,13 @@ RSpec.describe 'Meetings', 'Index', :with_cuprite dolet(:meeting_with_no_location) docreate(:meeting, project:, title: 'Boring meeting without a location!', start_time: 1.day.from_now, location: '')end+ let(:meeting_with_malicious_location) do+ create(:meeting,+ project:,+ title: 'Sneaky meeting!',+ start_time: 1.day.from_now,+ location: "<script>alert('Description');</script>")+ endlet(:yesterdays_meeting) docreate(:meeting, project:, title: 'Awesome meeting yesterday!', start_time: 1.day.ago)end@@ -189,6 +196,7 @@ RSpec.describe 'Meetings', 'Index', :with_cuprite doit "renders a link to each meeting's location if present and a valid URL" domeetingmeeting_with_no_location+ meeting_with_malicious_locationtomorrows_meetingmeetings_page.visit!@@ -196,6 +204,7 @@ RSpec.describe 'Meetings', 'Index', :with_cuprite domeetings_page.expect_link_to_meeting_location(meeting)meetings_page.expect_plaintext_meeting_location(tomorrows_meeting)meetings_page.expect_plaintext_meeting_location(other_project_meeting)+ meetings_page.expect_plaintext_meeting_location(meeting_with_malicious_location)meetings_page.expect_no_meeting_location(meeting_with_no_location)end@@ -361,11 +370,13 @@ RSpec.describe 'Meetings', 'Index', :with_cuprite doit "renders a link to each meeting's location if present and a valid URL" domeetingmeeting_with_no_location+ meeting_with_malicious_locationtomorrows_meetingmeetings_page.visit!meetings_page.expect_link_to_meeting_location(meeting)meetings_page.expect_plaintext_meeting_location(tomorrows_meeting)+ meetings_page.expect_plaintext_meeting_location(meeting_with_malicious_location)meetings_page.expect_no_meeting_location(meeting_with_no_location)endend