Skip to content
OpenAdvisories

Weakness (CWE)

CWE-185: Incorrect Regular Expression

Base Draft

The product specifies a regular expression in a way that causes data to be improperly matched or compared.

How to prevent it (1 mitigation)
  1. Implementation

    Regular expressions can become error prone when defining a complex language even for those experienced in writing grammars. Determine if several smaller regular expressions simplify one large regular expression. Also, subject the regular expression to thorough testing techniques such as equivalence partitioning, boundary value analysis, and robustness. After testing and a reasonable confidence level is achieved, a regular expression may not be foolproof. If an exploit is allowed to slip through, then record the exploit and refactor the regular expression.

Source: MITRE CWE-185

48 results · Feed

  • Medium 5.3

    uap-core Regular Expression Denial of Service issue

    An issue was discovered in regex.yaml (aka regexes.yaml) in UA-Parser UAP-Core before 0.6.0. A Regular Expression Denial of Service (ReDoS) issue allows remote attackers to overload a server by setting the User-Agent header in an HTTP(S) request to a value co…

  • High 7.5

    Mosca REDoS Vulnerability

    This vulnerability allows remote attackers to deny service on vulnerable installations of npm mosca 2.8.1. Authentication is not required to exploit this vulnerability. The specific flaw exists within the processing of topics. A crafted regular expression can…

  • High 7.5

    js-bson vulnerable to REDoS

    The MongoDB bson JavaScript module (also known as js-bson) versions 0.5.0 to 1.0.x before 1.0.5 is vulnerable to a Regular Expression Denial of Service (ReDoS) in lib/bson/decimal128.js. The flaw is triggered when the Decimal128.fromString() function is calle…

  • High 7.5

    Regular Expression Denial of Service in sshpk

    sshpk is vulnerable to ReDoS when parsing crafted invalid public keys.

  • Unscored —

    The `'path'` module in the Node.js 4.x release line contains a potential regular expression denial of service (ReDoS) v…

  • Medium 5.3

    Django Denial-of-service possibility in truncatechars_html and truncatewords_html template filters

    An issue was discovered in Django 2.0 before 2.0.3, 1.11 before 1.11.11, and 1.8 before 1.8.19. If django.utils.text.Truncator's chars() and words() methods were passed the html=True argument, they were extremely slow to evaluate certain inputs due to a catas…

  • Medium 5.3

    Django denial-of-service possibility in urlize and urlizetrunc template filters

    An issue was discovered in Django 2.0 before 2.0.3, 1.11 before 1.11.11, and 1.8 before 1.8.19. The django.utils.html.urlize() function was extremely slow to evaluate certain inputs due to catastrophic backtracking vulnerabilities in two regular expressions (…

  • Medium 5.9

    Apache Libcloud vulnerable to certificate impersonation

    Apache Libcloud before 0.11.1 uses an incorrect regular expression during verification of whether the server hostname matches a domain name in the subject's Common Name (CN) or subjectAltName field of the X.509 certificate, which allows man-in-the-middle atta…