You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm publishing this information in the faith that this vulnerability cannot be exploited easily in our context, because the Matomo server URL is a configuration setting that is not user supplied.
# domain name (characters separated by a dot), optional port, optional URI path, no slashDOMAINPATH_RE=re.compile(r'^(([^./?#@:]+\.)*[^./?#@:]+)+(:[0-9]+)?(/[^/?#@:]+)*$')
The problematic bit is the repetition (]+)+) after a piece that induces backtracking.
Anyone willing to assist in fixing this issue is very welcome! 🙏
Potential Solution Approaches
Simplify the regular expression (remove or limit the repetition)
Example: (note that urlparse alone seem unsuitable for our use case)
classMatomoNode(Node):
def__init__(self):
# avoid ReDoS vulnerability not using a regex with backtrackingparsable_url='//'+getattr(settings, 'MATOMO_DOMAIN_PATH', '')
result=urlparse(parsable_url)
ifresult.schemeor (notresult.netlocandnotresult.path):
# make this fail
We have been contacted by junior security researchers who pointed out that one of our regular expressions in the Matomo module makes software using Analytical vulnerable to Regular expression Denial of Service attacks (ReDoS).
I'm publishing this information in the faith that this vulnerability cannot be exploited easily in our context, because the Matomo server URL is a configuration setting that is not user supplied.
Details
From analytical/templatetags/matomo.py, line 20:
The problematic bit is the repetition (
]+)+
) after a piece that induces backtracking.Anyone willing to assist in fixing this issue is very welcome! 🙏
Potential Solution Approaches
Example: (note that
urlparse
alone seem unsuitable for our use case)Background Reading
The text was updated successfully, but these errors were encountered: