Skip to content

[BUG] Default Network Policy Allows All Public Traffic — Deny-by-Default is Illusory #613

@ionfwsrijan

Description

@ionfwsrijan

Description

settings.network_allowlist defaults to [] (empty list). When the allowlist is empty, _init_default_policies() automatically adds 0.0.0.0/0 and ::/0 as "Default allow all" rules. This means every network connection from any scanner (nuclei, nikto, nmap) to any public internet host is permitted unless the operator explicitly sets SECUSCAN_NETWORK_ALLOWLIST. The denylist only blocks RFC 1918 private addresses and cloud metadata IPs — it does nothing to restrict public egress. A compromised or misconfigured scan targeting an internal host would be blocked, but scanning arbitrary public hosts (including competitor infrastructure, malicious domains) is fully permitted.

Files Affected

  • secuscan/core/network_policy.py_init_default_policies() (lines 402-407)
  • secuscan/config.pysettings.network_allowlist default value (line 65)

Expected Behavior

With an empty allowlist and safe-mode enabled, all network egress should be blocked by default. The operator should explicitly opt-in to specific network destinations.

Actual Behavior

An empty allowlist causes _init_default_policies() to add 0.0.0.0/0 and ::/0 as default allow-all rules. Every public internet host is reachable. The denylist only blocks RFC 1918 private addresses, cloud metadata IPs, and known bad hosts.

Steps to Reproduce

  1. Start SecuScan with default configuration (no SECUSCAN_NETWORK_ALLOWLIST set)
  2. Enable safe-mode
  3. Run a scan targeting any public website (e.g., example.com)
  4. Observe that the scan completes successfully — the network policy did not block it
  5. Check _init_default_policies() — the empty allowlist triggered default allow-all

Impact

The entire enforce_network_policy security model is illusory. The tool is marketed as having network policy enforcement, but the default configuration permits all outbound scanning. This is a security product — such a misconfiguration defeats its core purpose.

Fix Required

Change _init_default_policies to default-deny instead of default-allow. The default should be that the allowlist blocks everything when empty, or at minimum log a loud startup warning that no allowlist is configured. The fix affects network_policy.py:402-407 and the initialization logic in config.py.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions