Skip to content

Commit

Permalink
Fixed ReDoS in 'loadAnnotation' function of previous-map.js.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sushant Mittal authored and xzyfer committed Aug 10, 2022
1 parent b55257b commit a53b6f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/previous-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default class PreviousMap {
}

loadAnnotation(css) {
let match = css.match(/\/\*\s*# sourceMappingURL=(.*)\s*\*\//);
let match = css.match(/\/\*\s*# sourceMappingURL=((?:(?!sourceMappingURL=).)*)\s*\*\//);
if ( match ) this.annotation = match[1].trim();
}

Expand Down

0 comments on commit a53b6f2

Please sign in to comment.