Skip to content

Latest commit

 

History

History
58 lines (29 loc) · 617 Bytes

File metadata and controls

58 lines (29 loc) · 617 Bytes

[New Account] Passwords containing %

HireRight uses weird regex for checking password length isValidLength()

Regex:


/^[^%\s]{8,}/

Demo website:


https://smuger.github.io/HireRightPassword-Problem/


issue

Which means that

Accept Deny
12345678 %2345678
qwertyui 123%5678

Code

function isValidLength(input) {
	var reg = /^[^%\s]{8,}/;
    return reg.test(input);
}

Solution

Change regex to /^[^\s]{8,}/ or Add a note that you cannot use %