Skip to content

Commit c4d74d8

Browse files
committed
fix: sanitize html in matrix
1 parent dca7650 commit c4d74d8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/pact_broker/ui/views/matrix/show.haml

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
- if defined?(errors) && errors.any?
1818
- errors.each do | error |
1919
%div.alert.alert-danger
20-
= error
20+
= escape_html(error)
2121

2222
%form{action: '/matrix', onsubmit:'return onSubmit()'}
2323
- selectors.each_with_index do | selector, index |
2424
.selector
2525
%label{for: "pacticipant#{index}"}
2626
Pacticipant name
27-
%input{name: 'q[]pacticipant', id: "pacticipant1#{index}", value: selector.pacticipant_name}
27+
%input{name: 'q[]pacticipant', id: "pacticipant1#{index}", value: escape_html(selector.pacticipant_name)}
2828

2929
.input-group
3030

@@ -41,9 +41,9 @@
4141
%option{ value: 'specify-all-tagged', selected: selector.specify_all_tagged }
4242
All versions with tag...
4343

44-
%input{name: 'q[]version', type: 'text', id: "pacticipant#{index}_version", class: 'version', value: selector.pacticipant_version_number}
44+
%input{name: 'q[]version', type: 'text', id: "pacticipant#{index}_version", class: 'version', value: escape_html(selector.pacticipant_version_number)}
4545

46-
%input{name: 'q[]tag', type: 'text', id: "pacticipant#{index}_tag", class: 'tag', value: selector.tag}
46+
%input{name: 'q[]tag', type: 'text', id: "pacticipant#{index}_tag", class: 'tag', value: escape_html(selector.tag)}
4747

4848
%input{name: 'q[]latest', value: 'true', hidden: true, class: 'latest-flag'}
4949

0 commit comments

Comments
 (0)