Added an extra layer of sanitization to error page links (#4953)
Этот коммит содержится в:
коммит произвёл
Corey Hulen
родитель
f1679cb2a0
Коммит
c0a5f9fbef
@@ -13,9 +13,11 @@ export default class ErrorPage extends React.Component {
|
|||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
$('body').attr('class', 'sticky error');
|
$('body').attr('class', 'sticky error');
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
$('body').attr('class', '');
|
$('body').attr('class', '');
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let title = this.props.location.query.title;
|
let title = this.props.location.query.title;
|
||||||
if (!title || title === '') {
|
if (!title || title === '') {
|
||||||
@@ -30,6 +32,9 @@ export default class ErrorPage extends React.Component {
|
|||||||
let link = this.props.location.query.link;
|
let link = this.props.location.query.link;
|
||||||
if (!link || link === '') {
|
if (!link || link === '') {
|
||||||
link = '/';
|
link = '/';
|
||||||
|
} else if (link.startsWith('javascript:') || link.startsWith('vbscript:') || link.startsWith('data:')) { // eslint-disable-line no-script-url
|
||||||
|
// Sanitize out any script links
|
||||||
|
link = '/';
|
||||||
}
|
}
|
||||||
|
|
||||||
let linkMessage = this.props.location.query.linkmessage;
|
let linkMessage = this.props.location.query.linkmessage;
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user