diff options
author | Phil Hughes <me@iamphill.com> | 2018-03-20 10:09:38 +0000 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2018-04-05 08:39:44 +0200 |
commit | 0498a5dd779250372aa12b4d6a0e53ef01d1b60b (patch) | |
tree | 4ec740f14642b9be0fd7d00ee496dd9ffb513dc4 /spec/features/issues | |
parent | 39bb3720381af64039673cf21705fcf95cf78314 (diff) | |
download | gitlab-ce-0498a5dd779250372aa12b4d6a0e53ef01d1b60b.tar.gz |
Merge branch 'fl-fix-milestone-bug-10-6' into 'security-10-6'
Escape miletone attribute when appending to the DOM
See merge request gitlab/gitlabhq!2359
Diffstat (limited to 'spec/features/issues')
-rw-r--r-- | spec/features/issues/form_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/features/issues/form_spec.rb b/spec/features/issues/form_spec.rb index 38c618d300e..4625a50b8d9 100644 --- a/spec/features/issues/form_spec.rb +++ b/spec/features/issues/form_spec.rb @@ -226,6 +226,23 @@ describe 'New/edit issue', :js do expect(page).to have_selector('.atwho-view') end + + describe 'milestone' do + let!(:milestone) { create(:milestone, title: '"><img src=x onerror=alert(document.domain)>', project: project) } + + it 'escapes milestone' do + click_button 'Milestone' + + page.within '.issue-milestone' do + click_link milestone.title + end + + page.within '.js-milestone-select' do + expect(page).to have_content milestone.title + expect(page).not_to have_selector 'img' + end + end + end end context 'edit issue' do |