T05 · Unauthorized Access and Privilege Escalation
- Location
app.py:581- Finding
Unauthenticated Remote Access to Workspace Files
- Content
View full analysis
') def get_file(req_path): abs_path, rel_path = normalize_and_validate_path(req_path) ... with open(abs_path, 'r', encoding='utf-8') as f: content = f.read() ... return jsonify(response) @app.route('/api/download/') def download_file(req_path): abs_path, rel_path = normalize_and_validate_path(req_path) ... return send_file( abs_path, as_attachment=True, download_name=os.path.basename(abs_path), mimetype='application/octet-stream' ) ``` ```python app.run( host='0.0.0.0', port=5001, debug=False, use_reloader=False, threaded=True ) ``` ```bash python3 app.py > app.log 2>&1 & echo "Workspace browser 3.0 started" echo "Access address: http://175.178.154.173:5001" ``` ### Technical Analysis The application exposes workspace enumeration, search, file reading, file downloading, explanation retrieval, and explanation-writing routes without any authentication or authorization. Binding Flask to `0.0.0.0` makes the service reachable through every available network interface rather than limiting it to the local host. The configured workspace is `/root/.openclaw/workspace`, which may contain source code, configuration files, credentials, tokens, and operational data belonging to a privileged user. The API does not enforce user identity, route-level permissions, or per-file access rules. ### Attack Path 1. An attacker reaches TCP port 5001 over the local network or public interface. 2. The attacker calls `/api/tree/` or `/api/search?q=...` t ...[truncated 732 chars]- Remediation
View remediation
