From d86cf6b1ebdcd5a17cd60748aca4602f5ef9f70f Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Fri, 23 Feb 2024 18:38:17 +0100 Subject: [PATCH 1/4] fix for .js config files --- package_linter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package_linter.py b/package_linter.py index 9e3d439..c1d6ea0 100755 --- a/package_linter.py +++ b/package_linter.py @@ -1575,7 +1575,7 @@ class Configurations(TestSuite): return for number, line in enumerate(content.split("\n"), 1): - comment = ("#", "//", ";") + comment = ("#", "//", ";", "/**", "*") if ( ( "0.0.0.0" in line or "::" in line ) and not line.strip().startswith(comment) From 8154a86f4c197bef5b75cb0f411e67d8e2942f3f Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Mon, 11 Mar 2024 04:04:32 +0100 Subject: [PATCH 2/4] ident fix (due to merge) --- package_linter.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/package_linter.py b/package_linter.py index fe345b9..9a84d4f 100755 --- a/package_linter.py +++ b/package_linter.py @@ -1577,20 +1577,20 @@ class Configurations(TestSuite): for number, line in enumerate(content.split("\n"), 1): comment = ("#", "//", ";", "/**", "*") - if ( - ( "0.0.0.0" in line or "::" in line ) - and not line.strip().startswith(comment) - ): - for ip in re.split("[ \t,='\"(){}\[\]]", line): - if ip == "::" or ip.startswith("0.0.0.0"): - yield Info( - f"{os.path.relpath(path, app.path)}/{filename}:{number}: " - "Binding to '0.0.0.0' or '::' can result in a security issue " - "as the reverse proxy and the SSO can be bypassed by knowing " - "a public IP (typically an IPv6) and the app port. " - "Please be sure that this behavior is intentional. " - "Maybe use '127.0.0.1' or '::1' instead." - ) + if ( + ( "0.0.0.0" in line or "::" in line ) + and not line.strip().startswith(comment) + ): + for ip in re.split("[ \t,='\"(){}\[\]]", line): + if ip == "::" or ip.startswith("0.0.0.0"): + yield Info( + f"{os.path.relpath(path, app.path)}/{filename}:{number}: " + "Binding to '0.0.0.0' or '::' can result in a security issue " + "as the reverse proxy and the SSO can be bypassed by knowing " + "a public IP (typically an IPv6) and the app port. " + "Please be sure that this behavior is intentional. " + "Maybe use '127.0.0.1' or '::1' instead." + ) ############################################# # __ __ _ __ _ # From d3609c6b6a329935949aa7e9e2f260ee58a79d20 Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Mon, 11 Mar 2024 04:06:02 +0100 Subject: [PATCH 3/4] ident fix (due to merge) ((really this time)) --- package_linter.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/package_linter.py b/package_linter.py index 9a84d4f..d6e9eff 100755 --- a/package_linter.py +++ b/package_linter.py @@ -1575,22 +1575,22 @@ class Configurations(TestSuite): yield Warning("Can't open/read %s: %s" % (os.path.join(path, filename), e)) return - for number, line in enumerate(content.split("\n"), 1): - comment = ("#", "//", ";", "/**", "*") - if ( - ( "0.0.0.0" in line or "::" in line ) - and not line.strip().startswith(comment) - ): - for ip in re.split("[ \t,='\"(){}\[\]]", line): - if ip == "::" or ip.startswith("0.0.0.0"): - yield Info( - f"{os.path.relpath(path, app.path)}/{filename}:{number}: " - "Binding to '0.0.0.0' or '::' can result in a security issue " - "as the reverse proxy and the SSO can be bypassed by knowing " - "a public IP (typically an IPv6) and the app port. " - "Please be sure that this behavior is intentional. " - "Maybe use '127.0.0.1' or '::1' instead." - ) + for number, line in enumerate(content.split("\n"), 1): + comment = ("#", "//", ";", "/**", "*") + if ( + ( "0.0.0.0" in line or "::" in line ) + and not line.strip().startswith(comment) + ): + for ip in re.split("[ \t,='\"(){}\[\]]", line): + if ip == "::" or ip.startswith("0.0.0.0"): + yield Info( + f"{os.path.relpath(path, app.path)}/{filename}:{number}: " + "Binding to '0.0.0.0' or '::' can result in a security issue " + "as the reverse proxy and the SSO can be bypassed by knowing " + "a public IP (typically an IPv6) and the app port. " + "Please be sure that this behavior is intentional. " + "Maybe use '127.0.0.1' or '::1' instead." + ) ############################################# # __ __ _ __ _ # From 39285a6072507fc128e86d2e1f5e27e8c5036cce Mon Sep 17 00:00:00 2001 From: Tagada <36127788+Tagadda@users.noreply.github.com> Date: Mon, 11 Mar 2024 15:00:32 +0100 Subject: [PATCH 4/4] Update package_linter.py --- package_linter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package_linter.py b/package_linter.py index d6e9eff..f43b83f 100755 --- a/package_linter.py +++ b/package_linter.py @@ -1576,7 +1576,7 @@ class Configurations(TestSuite): return for number, line in enumerate(content.split("\n"), 1): - comment = ("#", "//", ";", "/**", "*") + comment = ("#", "//", ";", "/*", "*") if ( ( "0.0.0.0" in line or "::" in line ) and not line.strip().startswith(comment)