We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents eb7c1bb + 27aa760 commit 6a651b7Copy full SHA for 6a651b7
admin/client/Signin/index.js
@@ -10,9 +10,10 @@ import React from 'react';
10
import ReactDOM from 'react-dom';
11
import Signin from './Signin';
12
13
+// Sanitize from param
14
+const internalFromRegex = /^\/[^\/\\]\w+/;
15
const params = qs.parse(window.location.search.replace(/^\?/, ''));
-const from = typeof params.from === 'string' && params.from.charAt(0) === '/'
- ? params.from : undefined;
16
+const from = internalFromRegex.test(params.from) ? params.from : undefined;
17
18
ReactDOM.render(
19
<Signin
0 commit comments