Skip to content

Commit

Permalink
fix ReDoS-vulnerable regexp in addImage (#3091)
Browse files Browse the repository at this point in the history
  • Loading branch information
yetingli committed Feb 11, 2021
1 parent c91995d commit d8bb3b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/addimage.js
Expand Up @@ -630,7 +630,7 @@ import { atob, btoa } from "../libs/AtobBtoa.js";
var result = null;

if (dataUrlParts.length === 2) {
var extractedInfo = /^data:(\w*\/\w*);*(charset=[\w=-]*)*;*$/.exec(
var extractedInfo = /^data:(\w*\/\w*);*(charset=(?!charset=)[\w=-]*)*;*$/.exec(
dataUrlParts[0]
);
if (Array.isArray(extractedInfo)) {
Expand Down

0 comments on commit d8bb3b3

Please sign in to comment.