Skip to content

Commit

Permalink
XSS fix (#1255)
Browse files Browse the repository at this point in the history
  • Loading branch information
bures committed May 16, 2022
1 parent d005407 commit 354467b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion client/src/login/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ export default class Login extends Component {
const submitSuccessful = await this.validateAndSendFormValuesToURL(FormSendMethod.POST, 'rest/login');

if (submitSuccessful) {
const nextUrl = qs.parse(this.props.location.search).next || getUrl();
const unsafeUrl = qs.parse(this.props.location.search).next
const safeUrl = unsafeUrl.replace(/[^a-zA-Z0-9/\-]/g, "");

const nextUrl = safeUrl || getUrl();

/* This ensures we get config for the authenticated user */
window.location = nextUrl;
Expand Down

0 comments on commit 354467b

Please sign in to comment.