Looking for the vulnerability index of Invicti's legacy products?
Python Debugger Unauthorized Access Vulnerability - Vulnerability Database

Python Debugger Unauthorized Access Vulnerability

Description

The application exposes an active Python debugpy debugger interface on a network-accessible port. The debugpy debugger provides full control over the Python runtime environment, including the ability to inspect variables, modify execution flow, and execute arbitrary Python code. When exposed without authentication or network restrictions, this debugging interface becomes a critical security vulnerability that allows unauthorized remote access to the application's execution environment.

Remediation

Immediately disable the debugpy debugger in production environments. If debugging capabilities are required, implement the following controls:

1. Remove or comment out debugpy initialization code from production deployments:

import debugpy
# debugpy.listen(5678)  # Remove this line in production

2. Use environment-based configuration to ensure debuggers only run in development:
import os
if os.getenv('ENVIRONMENT') == 'development':
    import debugpy
    debugpy.listen(('127.0.0.1', 5678))

3. If debugging is absolutely necessary in non-development environments, bind the debugger to localhost only (127.0.0.1) and access it through SSH tunneling rather than exposing it to the network.

4. Implement network-level restrictions using firewalls or security groups to block external access to debugger ports (typically 5678).

5. Establish deployment processes that automatically strip debugging code from production builds.

Related Vulnerabilities