mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Graph: Fix XSS vulnerability with series overrides (#25401)
* Fix XSS vulnerability with Graph series overrides * Update public/app/plugins/datasource/testdata/partials/query.editor.html
This commit is contained in:
parent
c7e38fd47f
commit
c53435f7a7
@ -7,7 +7,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="gf-form max-width-15">
|
<div class="gf-form max-width-15">
|
||||||
<label class="gf-form-label query-keyword">Alias</label>
|
<label class="gf-form-label query-keyword">Alias</label>
|
||||||
<input type="text" class="gf-form-input" ng-model="ctrl.target.alias" spellcheck='false' placeholder="alias patterns" ng-blur="ctrl.refresh()">
|
<input type="text" class="gf-form-input" ng-model="ctrl.target.alias" spellcheck='false' placeholder="alias patterns" ng-blur="ctrl.refresh()" pattern='[^<>&\\"]+'>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="gf-form">
|
<div class="gf-form">
|
||||||
<label class="gf-form-label query-keyword width-7">Alias</label>
|
<label class="gf-form-label query-keyword width-7">Alias</label>
|
||||||
<input type="text" class="gf-form-input width-14" placeholder="optional" ng-model="ctrl.target.alias" ng-change="ctrl.refresh()" ng-model-onblur>
|
<input type="text" class="gf-form-input width-14" placeholder="optional" ng-model="ctrl.target.alias" ng-model-onblur ng-change="ctrl.refresh()" pattern='[^<>&\\"]+'>
|
||||||
</div>
|
</div>
|
||||||
<div ng-if="ctrl.showLabels" class="gf-form gf-form--grow">
|
<div ng-if="ctrl.showLabels" class="gf-form gf-form--grow">
|
||||||
<label class="gf-form-label query-keyword width-7">
|
<label class="gf-form-label query-keyword width-7">
|
||||||
@ -215,7 +215,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="gf-form-inline" ng-if="ctrl.scenario.id === 'arrow'">
|
<div class="gf-form-inline" ng-if="ctrl.scenario.id === 'arrow'">
|
||||||
<div class="gf-form" style="width: 100%;">
|
<div class="gf-form" style="width: 100%;">
|
||||||
<textarea type="string"
|
<textarea type="string"
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import coreModule from 'app/core/core_module';
|
import coreModule from 'app/core/core_module';
|
||||||
|
import { textUtil } from '@grafana/data';
|
||||||
|
|
||||||
/** @ngInject */
|
/** @ngInject */
|
||||||
export function SeriesOverridesCtrl($scope: any, $element: JQuery, popoverSrv: any) {
|
export function SeriesOverridesCtrl($scope: any, $element: JQuery, popoverSrv: any) {
|
||||||
@ -79,7 +80,7 @@ export function SeriesOverridesCtrl($scope: any, $element: JQuery, popoverSrv: a
|
|||||||
|
|
||||||
$scope.getSeriesNames = () => {
|
$scope.getSeriesNames = () => {
|
||||||
return _.map($scope.ctrl.seriesList, series => {
|
return _.map($scope.ctrl.seriesList, series => {
|
||||||
return series.alias;
|
return textUtil.escapeHtml(series.alias);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user