Skip to content

Commit b8f6039

Browse files
simonpasquiergotjosh
authored andcommitted
Check the validity of the generatorURL field
The Source button should only be displayed if the link starts by 'http://' or 'https://'. Signed-off-by: Simon Pasquier <spasquie@redhat.com>
1 parent 6fe1a24 commit b8f6039

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 0.26.0-rc.0 / 2023-08-17
1+
## 0.26.0 / 2022-08-23
22

33
* [CHANGE] Telegram Integration: `api_url` is now optional. #2981
44
* [CHANGE] Telegram Integration: `ParseMode` default is now `HTML` instead of `MarkdownV2`. #2981
@@ -25,6 +25,7 @@
2525
* [BUGFIX] API: Fixed duplicate receiver names in the `api/v2/receivers` API endpoint. #3338
2626
* [BUGFIX] API: Attempting to delete a silence now returns the correct status code, `404` instead of `500`. #3352
2727
* [BUGFIX] Clustering: Fixes a panic when `tls_client_config` is empty. #3443
28+
* [BUGFIX] Fix stored XSS via the /api/v1/alerts endpoint in the Alertmanager UI.
2829

2930
## 0.25.0 / 2022-12-22
3031

asset/assets_vfsdata.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/app/src/Views/Shared/Alert.elm

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,12 @@ titleView alert =
4545

4646
generatorUrlButton : String -> Html msg
4747
generatorUrlButton url =
48-
a
49-
[ class "btn btn-outline-info border-0", href url ]
50-
[ i [ class "fa fa-line-chart mr-2" ] []
51-
, text "Source"
52-
]
48+
if String.startsWith "http://" url || String.startsWith "https://" url then
49+
a
50+
[ class "btn btn-outline-info border-0", href url ]
51+
[ i [ class "fa fa-line-chart mr-2" ] []
52+
, text "Source"
53+
]
54+
55+
else
56+
text ""

0 commit comments

Comments
 (0)