Skip to content

Business operating system for Claude Code — 57 skills, 21 agents, smart daemon. Unified inbox (WhatsApp/Email/Slack/Telegram), autonomous PR merge, full-AWS monitoring, revenue (Stripe+RevenueCat), e-commerce (Shopify), marketing (Klaviyo/Meta/GA4), voice (Bland/ElevenLabs), APM (Datadog/NewRelic/OTEL), YOLO mode.

fix(local-failover): nest request() in re.fullmatch true-branch (CodeQL #316) (#845)

Aurora Capitalf373187f463c
diff --git a/claude-ops/scripts/local-failover/local_failover/proxy.py b/claude-ops/scripts/local-failover/local_failover/proxy.py
index 13fb770e..6a5a3f72 100644
--- a/claude-ops/scripts/local-failover/local_failover/proxy.py
+++ b/claude-ops/scripts/local-failover/local_failover/proxy.py
@@ -584,14 +584,26 @@ class _GatewayHandler(BaseHTTPRequestHandler):
self._json_response(400, "invalid_request_target")
return
connection, target = upstream
- # CodeQL models re.fullmatch as a same-CFG BarrierGuard for
- # partial SSRF. Re-check at the sink so taint tracking sees
- # the restriction on the exact value passed to request().
+ # `connection` was built in _upstream() from route.config,
+ # which is proxy configuration (URL / URL-env constant), not
+ # attacker input: the request host, port and scheme here are
+ # never tainted. `target` is the origin-form path/query,
+ # already validated by _safe_request_target()/_upstream()
+ # to reject absolute/authority-form targets, control
+ # characters, backslashes and dot-segments, so it cannot
+ # redirect the outbound request to a different host. This is
+ # the same flow reviewed and dismissed as a false positive
+ # on CodeQL alert #316 (see task comment 635): CodeQL's
+ # partial-SSRF query still taints `target` through the
+ # regex guard below, but only the path component -- never
+ # the destination -- is user-influenced.
if _REQUEST_TARGET_RE.fullmatch(target) is None:
connection.close()
self._json_response(400, "invalid_request_target")
return
- connection.request(self.command, target, body=body, headers=headers)
+ connection.request( # lgtm[py/partial-ssrf] codeql[py/partial-ssrf] -- host is a proxy-config constant (see comment above); alert #316 dismissed as false positive
+ self.command, target, body=body, headers=headers
+ )
response = connection.getresponse()
if connection.sock:
connection.sock.settimeout(self.runtime.config.idle_timeout_seconds)