Skip to content

Commit 40a50ad

Browse files
Merge pull request #3 from ivan-dinkov/regex-fix
Adding percent sign to accommodate URL encoding for extra scopes
2 parents af4228b + 9aafd61 commit 40a50ad

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/OAuthImplicit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class OAuthImplicit {
4949
// Avoiding an injection attack: check that the hash only includes expected characters
5050
// An example: #access_token=eyJ0eXA...[Access tokens can be 610 characters or longer]...wKVQLqF6A&expires_in=28800&token_type=bearer&state=e3f287fbe93...c58bd6a67fe2
5151
// No characters other than #.-&=_ a-z A-Z 0-9 (no spaces)
52-
const hashRegex = /[^#.\-&=_a-zA-Z0-9]/;
52+
const hashRegex = /[^#.%\-&=_a-zA-Z0-9]/;
5353
if (hash.search(hashRegex) !== -1) {
5454
console.error (`Potential XSS attack via fragment (#) value: ${hash}`);
5555
toast.error('Potential XSS attack via the fragment value. Please login again.', {

0 commit comments

Comments
 (0)