Skip to content

Commit 40f4345

Browse files
fix: ReDoS problem
1 parent 52cd134 commit 40f4345

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/interpolateName.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function interpolateName(loaderContext, name, options = {}) {
7676
// `hash` and `contenthash` are same in `loader-utils` context
7777
// let's keep `hash` for backward compatibility
7878
.replace(
79-
/\[(?:([^:\]]+):)?(?:hash|contenthash)(?::([a-z]+\d*))?(?::(\d+))?\]/gi,
79+
/\[(?:([^[:\]]+):)?(?:hash|contenthash)(?::([a-z]+\d*))?(?::(\d+))?\]/gi,
8080
(all, hashType, digestType, maxLength) =>
8181
getHashDigest(content, hashType, digestType, parseInt(maxLength, 10))
8282
);

0 commit comments

Comments
 (0)