Skip to content

Commit 17cbf8f

Browse files
authoredNov 11, 2022
fix: ReDoS problem (#226)
1 parent 8f082b3 commit 17cbf8f

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
@@ -108,7 +108,7 @@ function interpolateName(loaderContext, name, options) {
108108
// `hash` and `contenthash` are same in `loader-utils` context
109109
// let's keep `hash` for backward compatibility
110110
.replace(
111-
/\[(?:([^:\]]+):)?(?:hash|contenthash)(?::([a-z]+\d*))?(?::(\d+))?\]/gi,
111+
/\[(?:([^[:\]]+):)?(?:hash|contenthash)(?::([a-z]+\d*))?(?::(\d+))?\]/gi,
112112
(all, hashType, digestType, maxLength) =>
113113
getHashDigest(content, hashType, digestType, parseInt(maxLength, 10))
114114
)

0 commit comments

Comments
 (0)
Please sign in to comment.