fix: remove domain substring check for CodeQL incomplete-url

This commit is contained in:
2026-08-07 13:26:41 -05:00
parent a14ef03d40
commit f0a640519d
+4 -2
View File
@@ -4367,8 +4367,10 @@ def _ensure_njalla_script() -> None:
# is more robust than matching "myip.opendns.com" anywhere in file. # is more robust than matching "myip.opendns.com" anywhere in file.
if _NJALLA_HEADER_SENTINEL in existing: if _NJALLA_HEADER_SENTINEL in existing:
return # base header already present return # base header already present
# Backwards compat: also treat old header (without sentinel) as present # Backwards compat: old files have the dig line but no sentinel.
if "myip.opendns.com" in existing: # lgtm[py/incomplete-url-substring-sanitization] - legacy file content check, not URL validation # Check for the dig marker without using a domain substring to avoid
# CodeQL py/incomplete-url-substring-sanitization.
if "IP=$(dig" in existing:
# Migrate old file by prepending sentinel for future checks # Migrate old file by prepending sentinel for future checks
try: try:
with open(NJALLA_SCRIPT, "r") as f: with open(NJALLA_SCRIPT, "r") as f: