Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d2d752d

Browse filesBrowse files
fix: ReDoS problem (#224)
1 parent 52cd134 commit d2d752d
Copy full SHA for d2d752d

File tree

2 files changed

+991
-897
lines changed
Filter options

2 files changed

+991
-897
lines changed

‎lib/interpolateName.js

Copy file name to clipboardExpand all lines: lib/interpolateName.js
+1-1Lines changed: 1 addition & 1 deletion
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.