Skip to content

Commit

Permalink
fix: uri encode template replacement to ovoid XSS
Browse files Browse the repository at this point in the history
  • Loading branch information
SiCoe committed Sep 22, 2023
1 parent f4c0e44 commit 8455c15
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions authn/pkce.index.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,9 @@ function unauthorized(error, error_description, error_uri, callback) {
</html>
`;

page = page.replace(/%error%/g, error);
page = page.replace(/%error_description%/g, error_description);
page = page.replace(/%error_uri%/g, error_uri);
page = page.replace(/%error%/g, encodeURI(error).replace(/%20/g,' '));
page = page.replace(/%error_description%/g, encodeURI(error_description).replace(/%20/g,' '));
page = page.replace(/%error_uri%/g, encodeURI(error_uri));

// Unauthorized access attempt. Reset token and nonce cookies
const response = {
Expand Down

0 comments on commit 8455c15

Please sign in to comment.