Browse Source

fix(core): Fix polynomial regex vulnerability

Fixes https://github.com/vendure-ecommerce/vendure/security/code-scanning/19
Michael Bromley 4 years ago
parent
commit
6675757d97
1 changed files with 1 additions and 1 deletions
  1. 1 1
      packages/core/src/api/common/extract-session-token.ts

+ 1 - 1
packages/core/src/api/common/extract-session-token.ts

@@ -35,7 +35,7 @@ function getFromCookie(req: Request): string | undefined {
 function getFromHeader(req: Request): string | undefined {
     const authHeader = req.get('Authorization');
     if (authHeader) {
-        const matches = authHeader.match(/bearer\s+(.+)$/i);
+        const matches = authHeader.match(/bearer\s(.+)$/i);
         if (matches) {
             return matches[1];
         }