|
const {1: mime} = /^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec( |
|
parsed.pathname |
|
) || [null, null, null] |
The ESLint rule regexp/no-super-linear-backtracking reports that
The quantifier '[^;,]+' can exchange characters with '[^,]*?'. Using any string accepted by /[^,;]+/, this can be exploited to cause at least polynomial backtracking.
For example, if the pathname is ./aaaaaaaaaaaB, the back tracking becomes polynomial since both [^;,]+ and [^,]*? match a.
import-meta-resolve/lib/get-format.js
Lines 64 to 66 in 88a0e38
The ESLint rule
regexp/no-super-linear-backtrackingreports thatFor example, if the pathname is
./aaaaaaaaaaaB, the back tracking becomes polynomial since both[^;,]+and[^,]*?matcha.