VYPR
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.

PackageAffected versionsPatched versions
knwl.jsnpm
<= 1.0.2

Patches

1
88aa966b1415

Change links.js regex

https://github.com/benhmoore/KnwlDawid RodakSep 23, 2023via ghsa
1 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

News mentions

0

No linked articles in our index yet.