[BUGFIX] AlertTable: only link runbook annotations that are http(s) URLs - #829
Merged
jgbernalp merged 3 commits intoOct 1, 2026
Merged
Conversation
Signed-off-by: Yash Lunawat <yash.lunawat@rtp.vc>
jgbernalp
reviewed
Sep 23, 2026
| '//evil.example.com/malicious', | ||
| 'file:///etc/passwd', | ||
| ' javascript:alert(1)', | ||
| '/runbooks/alert', |
Contributor
There was a problem hiding this comment.
relative urls should be allowed as they might redirect to safe internal URLS when perses panels are used in embedded mode.
Contributor
Author
There was a problem hiding this comment.
Done in d9f4228: the annotation now resolves against the current page and links if the result is http(s), so /runbooks/alert and runbooks/alert link again. One side effect: //host/path also links, since it resolves to https://host/path, the same as an absolute https URL. javascript:, data:, file:, vbscript: and mailto: are still refused.
Contributor
|
@Yash121l mind checking the last comment?, it seems that is the only thing holding this PR |
Contributor
Author
|
Hey, I'll check this tonight! |
Signed-off-by: Yash Lunawat <yash.lunawat@rtp.vc>
Signed-off-by: Yash Lunawat <yash.lunawat@rtp.vc>
Contributor
Author
|
@jgbernalp can you have a look on this now |
jgbernalp
approved these changes
Oct 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes perses/perses#4473.
The Alert Table put the
runbook_urlannotation straight into the link'shref, so any value got a "View runbook" button:javascript:,data:,vbscript:andfile:included. The panel runs React 18, which only warns aboutjavascript:URLs rather than blocking them.Now the button only appears when the annotation resolves to an
http:orhttps:URL. Relative URLs resolve against the current page, so/runbooks/alertstill links, which matters when panels are embedded. Anything else gets no button.AlertTablePanel.test.tsxrenders the panel with each annotation from the issue. Onmainevery one of them gets a link. With this changejavascript:,data:,file:,vbscript:andmailto:get none, while absolute, relative and protocol-relative http(s) URLs still link.Screenshots
No visual change for valid runbook URLs.
Checklist
[<catalog_entry>] <commit message>naming convention using one of thefollowing
catalog_entryvalues:FEATURE,ENHANCEMENT,BUGFIX,BREAKINGCHANGE,DOC,IGNORE.UI Changes