mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-02 21:32:10 +03:00
fix(security): linear-time Basic-auth regex in the dev webdav handler (CodeQL js/polynomial-redos #708)
This commit is contained in:
@@ -205,7 +205,7 @@ export function resolveDestinationPath(vaultRoot, destinationHeader) {
|
||||
export function verifyBasicAuth(authHeader, expectedUsername, expectedPassword) {
|
||||
if (!authHeader || typeof authHeader !== "string") return false;
|
||||
|
||||
const match = /^Basic\s+(.+)$/i.exec(authHeader.trim());
|
||||
const match = /^Basic[ \t]+(\S+)$/i.exec(authHeader.trim()); // linear-time: no overlapping \s+/.+ backtracking (CodeQL js/polynomial-redos #708)
|
||||
if (!match) return false;
|
||||
|
||||
let decoded;
|
||||
|
||||
Reference in New Issue
Block a user