Skip to content

Commit

Permalink
fix: ReDoS problem (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Nov 11, 2022
1 parent 7162619 commit ac09944
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/interpolateName.js
Expand Up @@ -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))
)
Expand Down

0 comments on commit ac09944

Please sign in to comment.