mirror of
https://github.com/grafana/grafana.git
synced 2024-11-30 12:44:10 -06:00
Security: Fix XSS in runbook URL (#59540)
Fix XSS in runbook URL Co-authored-by: George Robinson <george.robinson@grafana.com>
This commit is contained in:
parent
701d1b135e
commit
ba0b2dfa1a
@ -1,7 +1,7 @@
|
||||
import { css } from '@emotion/css';
|
||||
import React, { FC, Fragment } from 'react';
|
||||
|
||||
import { GrafanaTheme2 } from '@grafana/data';
|
||||
import { GrafanaTheme2, textUtil } from '@grafana/data';
|
||||
import { Button, HorizontalGroup, LinkButton, useStyles2 } from '@grafana/ui';
|
||||
import { contextSrv } from 'app/core/services/context_srv';
|
||||
import { AccessControlAction } from 'app/types';
|
||||
@ -61,7 +61,7 @@ export const RuleDetailsActionButtons: FC<Props> = ({ rule, rulesSource }) => {
|
||||
variant="primary"
|
||||
icon="book"
|
||||
target="__blank"
|
||||
href={rule.annotations[Annotation.runbookURL]}
|
||||
href={textUtil.sanitizeUrl(rule.annotations[Annotation.runbookURL])}
|
||||
>
|
||||
View runbook
|
||||
</LinkButton>
|
||||
|
Loading…
Reference in New Issue
Block a user