From 8697d8487bb69cc07e29d1d3e9c0253ae4638d38 Mon Sep 17 00:00:00 2001 From: Anurag Agarwal Date: Wed, 18 Jun 2025 06:32:12 +0000 Subject: [PATCH] Fix for DoS vulnerability GHSA-wgc6-9f6w-h8hx --- microlight.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/microlight.js b/microlight.js index 5aa193a..7f00ac0 100644 --- a/microlight.js +++ b/microlight.js @@ -42,6 +42,11 @@ for (i = 0; el = microlighted[i++];) { var text = el.textContent, + // Add a limit to the text length to prevent DoS + lenLimit = 10000; + if (text.length > lenLimit) { + text = text.slice(0, lenLimit); + } pos = 0, // current position next1 = text[0], // next character chr = 1, // current character