Skip to content
Permalink
Browse files
fix: ReDoS problem (#225)
  • Loading branch information
alexander-akait committed Nov 11, 2022
1 parent 7162619 commit ac09944
Showing 1 changed file with 1 addition and 1 deletion.
@@ -108,7 +108,7 @@ function interpolateName(loaderContext, name, options) {
// `hash` and `contenthash` are same in `loader-utils` context
// let's keep `hash` for backward compatibility
.replace(
/\[(?:([^:\]]+):)?(?:hash|contenthash)(?::([a-z]+\d*))?(?::(\d+))?\]/gi,
/\[(?:([^[:\]]+):)?(?:hash|contenthash)(?::([a-z]+\d*))?(?::(\d+))?\]/gi,
(all, hashType, digestType, maxLength) =>
getHashDigest(content, hashType, digestType, parseInt(maxLength, 10))
)

0 comments on commit ac09944

Please sign in to comment.