From 187f7c7bcf95097648230c34a7cf7d857dc0aeea Mon Sep 17 00:00:00 2001 From: Taus Date: Fri, 27 Mar 2026 22:44:39 +0000 Subject: [PATCH] Python: Move isNetworkBind check into isSink --- .../CVE-2018-1281/BindToAllInterfaces.ql | 20 ++++++------------- .../BindToAllInterfaces.expected | 1 - 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/python/ql/src/Security/CVE-2018-1281/BindToAllInterfaces.ql b/python/ql/src/Security/CVE-2018-1281/BindToAllInterfaces.ql index 75c145ec0ac..14c17edc359 100644 --- a/python/ql/src/Security/CVE-2018-1281/BindToAllInterfaces.ql +++ b/python/ql/src/Security/CVE-2018-1281/BindToAllInterfaces.ql @@ -34,7 +34,11 @@ private module BindToAllInterfacesConfig implements DataFlow::ConfigSig { } predicate isSink(DataFlow::Node sink) { - ModelOutput::sinkNode(sink, "bind-socket-all-interfaces") + ModelOutput::sinkNode(sink, "bind-socket-all-interfaces") and + // Network socket addresses are tuples like (host, port), so we require + // the bind() argument to originate from a tuple expression. This excludes + // AF_UNIX sockets, which pass a plain string path to bind(). + any(DataFlow::LocalSourceNode n | n.asExpr() instanceof Tuple).flowsTo(sink) } } @@ -42,20 +46,8 @@ private module BindToAllInterfacesFlow = TaintTracking::Global