High severityNVD Advisory· Published Oct 26, 2024· Updated Apr 15, 2026
CVE-2020-26306
CVE-2020-26306
Description
Knwl.js is a Javascript library that parses through text for dates, times, phone numbers, emails, places, and more. Versions 1.0.2 and prior contain one or more regular expressions that are vulnerable to Regular Expression Denial of Service (ReDoS). As of time of publication, no known patches are available.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
knwl.jsnpm | <= 1.0.2 | — |
Patches
11 file changed · +8 −1
default_plugins/links.js+8 −1 modified@@ -11,7 +11,14 @@ function Links(knwl) { for (var i = 0; i < words.length; i++) { var word = words[i].replace(/[\(\)!]/g, ""); // replaces every bracket ')' or '(' and every '!' with an empty character - if (/^(https?|ftp):\/\/(-\.)?([^\s\/?\.#-]+\.?)+(\/[^\s]*)?$/i.test(word)) { + + // https://stackoverflow.com/a/3809435 + var expression = + /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/gi + + var regex = new RegExp(expression) + + if (regex.test(word)) { var link = word; if (link[link.length - 1].search(/[?.!,]/g) !== -1) { link = link.substr(0, link.length-1);
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
6- github.com/advisories/GHSA-68qg-g787-3rp5ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2020-26306ghsaADVISORY
- securitylab.github.com/advisories/GHSL-2020-296-redos-Knwl.jsghsaADVISORY
- github.com/benhmoore/Knwl/commit/88aa966b1415a167c7c91b70053b72c7762c1cc0ghsaWEB
- github.com/benhmoore/Knwl/issues/106nvdWEB
- securitylab.github.com/advisories/GHSL-2020-296-redos-Knwl.js/nvd
News mentions
0No linked articles in our index yet.