Skip to content

Don't let AI subnet probes scan public neighboring hosts - #21

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-management-af1c
Draft

Don't let AI subnet probes scan public neighboring hosts#21
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-management-af1c

Conversation

@cursor

@cursor cursor Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Bug and impact

AI-directed subnet probing (probe_targets) could TCP-connect to hosts on a public /24 that the operator never authorized.

Trigger: a scan of a public target (e.g. scanme.nmap.org) with probing + AI enabled. The subnet director returns neighboring IPs; _run_subnet / the deep coordinator pass allowed_net=_subnet_of(target_ip) (a public /24). Those neighbors were then probed.

That is unauthorized scanning of third-party hosts from the user's agent (and from SaaS workers).

Root cause

9452ed1 added an RFC1918 gate, then replaced it wholesale with allowed_net when that argument was set. Callers always pass _subnet_of(target_ip), so a public target turned the allowlist into that host's public /24 instead of narrowing RFC1918.

Fix

RFC1918 is mandatory. allowed_net may only narrow (keep probes on the target's private /24), never enlarge the set to public space.

Validation

  • python3 -m pytest test_ip_scope.py -q — 12 passed (including new public-allowed_net and RFC1918-narrowing cases)
  • Related suite test_ip_scope.py test_security.py test_security_hardening.py test_ai_agent.py — 72 passed
Open in Web View Automation 

probe_targets replaced the RFC1918 allowlist with allowed_net. Callers pass
_subnet_of(target_ip), so a public scan target became a public /24 and
AI-selected neighbors were connected to without authorization.

Co-authored-by: dmitryflynn <dmitryflynn@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant