From c306cee04e00c10ba37bcddaf1d443166e432089 Mon Sep 17 00:00:00 2001 From: Rasmus Lerchedahl Petersen Date: Wed, 30 Jun 2021 15:03:22 +0200 Subject: [PATCH] Python: mimic JS file hierarchy --- config/identical-files.json | 6 +++--- python/ql/src/Security/CWE-730/PolynomialBackTracking.ql | 2 +- python/ql/src/Security/CWE-730/PolynomialReDoS.ql | 2 +- python/ql/src/Security/CWE-730/ReDoS.ql | 2 +- .../performance}/ExponentialBackTracking.qll | 0 .../python/{regex => security/performance}/ReDoSUtil.qll | 0 .../{regex => security/performance}/RegExpTreeView.qll | 0 .../performance}/SuperlinearBackTracking.qll | 0 8 files changed, 6 insertions(+), 6 deletions(-) rename python/ql/src/semmle/python/{regex => security/performance}/ExponentialBackTracking.qll (100%) rename python/ql/src/semmle/python/{regex => security/performance}/ReDoSUtil.qll (100%) rename python/ql/src/semmle/python/{regex => security/performance}/RegExpTreeView.qll (100%) rename python/ql/src/semmle/python/{regex => security/performance}/SuperlinearBackTracking.qll (100%) diff --git a/config/identical-files.json b/config/identical-files.json index b3be90b75b2..e12be2c91c7 100644 --- a/config/identical-files.json +++ b/config/identical-files.json @@ -451,14 +451,14 @@ ], "ReDoS Util Python/JS": [ "javascript/ql/src/semmle/javascript/security/performance/ReDoSUtil.qll", - "python/ql/src/semmle/python/regex/ReDoSUtil.qll" + "python/ql/src/semmle/python/security/performance/ReDoSUtil.qll" ], "ReDoS Exponential Python/JS": [ "javascript/ql/src/semmle/javascript/security/performance/ExponentialBackTracking.qll", - "python/ql/src/semmle/python/regex/ExponentialBackTracking.qll" + "python/ql/src/semmle/python/security/performance/ExponentialBackTracking.qll" ], "ReDoS Polynomial Python/JS": [ "javascript/ql/src/semmle/javascript/security/performance/SuperlinearBackTracking.qll", - "python/ql/src/semmle/python/regex/SuperlinearBackTracking.qll" + "python/ql/src/semmle/python/security/performance/SuperlinearBackTracking.qll" ] } diff --git a/python/ql/src/Security/CWE-730/PolynomialBackTracking.ql b/python/ql/src/Security/CWE-730/PolynomialBackTracking.ql index a98d4eefa7e..628aca57955 100644 --- a/python/ql/src/Security/CWE-730/PolynomialBackTracking.ql +++ b/python/ql/src/Security/CWE-730/PolynomialBackTracking.ql @@ -1,5 +1,5 @@ import python -import semmle.python.regex.SuperlinearBackTracking +import semmle.python.security.performance.SuperlinearBackTracking from PolynomialBackTrackingTerm t where t.getLocation().getFile().getBaseName() = "KnownCVEs.py" diff --git a/python/ql/src/Security/CWE-730/PolynomialReDoS.ql b/python/ql/src/Security/CWE-730/PolynomialReDoS.ql index b948c1601a8..0d92ab2d3f5 100644 --- a/python/ql/src/Security/CWE-730/PolynomialReDoS.ql +++ b/python/ql/src/Security/CWE-730/PolynomialReDoS.ql @@ -12,7 +12,7 @@ */ import python -import semmle.python.regex.SuperlinearBackTracking +import semmle.python.security.performance.SuperlinearBackTracking import semmle.python.security.dataflow.PolynomialReDoS import DataFlow::PathGraph diff --git a/python/ql/src/Security/CWE-730/ReDoS.ql b/python/ql/src/Security/CWE-730/ReDoS.ql index aebc2f81cff..e44699d7be8 100644 --- a/python/ql/src/Security/CWE-730/ReDoS.ql +++ b/python/ql/src/Security/CWE-730/ReDoS.ql @@ -13,7 +13,7 @@ */ import python -import semmle.python.regex.ExponentialBackTracking +import semmle.python.security.performance.ExponentialBackTracking from RegExpTerm t, string pump, State s, string prefixMsg where diff --git a/python/ql/src/semmle/python/regex/ExponentialBackTracking.qll b/python/ql/src/semmle/python/security/performance/ExponentialBackTracking.qll similarity index 100% rename from python/ql/src/semmle/python/regex/ExponentialBackTracking.qll rename to python/ql/src/semmle/python/security/performance/ExponentialBackTracking.qll diff --git a/python/ql/src/semmle/python/regex/ReDoSUtil.qll b/python/ql/src/semmle/python/security/performance/ReDoSUtil.qll similarity index 100% rename from python/ql/src/semmle/python/regex/ReDoSUtil.qll rename to python/ql/src/semmle/python/security/performance/ReDoSUtil.qll diff --git a/python/ql/src/semmle/python/regex/RegExpTreeView.qll b/python/ql/src/semmle/python/security/performance/RegExpTreeView.qll similarity index 100% rename from python/ql/src/semmle/python/regex/RegExpTreeView.qll rename to python/ql/src/semmle/python/security/performance/RegExpTreeView.qll diff --git a/python/ql/src/semmle/python/regex/SuperlinearBackTracking.qll b/python/ql/src/semmle/python/security/performance/SuperlinearBackTracking.qll similarity index 100% rename from python/ql/src/semmle/python/regex/SuperlinearBackTracking.qll rename to python/ql/src/semmle/python/security/performance/SuperlinearBackTracking.qll