T05 · Unauthorized Access and Privilege Escalation
- Location
skills/agent-factory/dashboard/app.py:85- Finding
Unauthenticated Network API Exposes Privileged Agent-Factory Operations
- Content
View full analysis
Vulnerability Details
File Location:
skills/agent-factory/dashboard/app.py, lines 85–141 and 180–181
Vulnerability Type: Missing authentication and authorization on state-changing API endpoints
Risk Level: HighVulnerable Code
python def do_POST(self): parsed = urlparse(self.path) path = parsed.path content_length = int(self.headers.get("Content-Length", 0)) body = self.rfile.read(content_length) if content_length > 0 else b"{}" try: payload = json.loads(body.decode("utf-8")) if body else {} except Exception: payload = {} if path == "/api/route": prompt = payload.get("prompt", "").strip() if not prompt: self._set_headers("application/json", 400) self.wfile.write(json.dumps({"error": "Prompt cannot be empty"}).encode("utf-8")) return result = route_and_execute(prompt) self._set_headers("application/json") self.wfile.write(json.dumps(result).encode("utf-8")) elif path == "/api/evolve-prompt": base_prompt = payload.get("prompt", "Tu es un agent spécialisé.") domain = payload.get("domain", "general") generations = payload.get("generations", 3) evolved = evolve_prompt(base_prompt, domain, generations=generations) self._set_headers("application/json") self.wfile.write(json.dumps(evolved).encode("utf-8")) elif path == "/api/execute-dag": tasks = payload.get("tasks", []) nodes = [TaskNode(t["id"], t["prompt"], t.get("depends_on", [])) for t in tasks] coordinator = DAGCoordinator() dag_result = coordinator.execute_dag(nodes) self._set_headers("application/json") self.wfile.write(json.dumps(dag_result).encode("utf-8")) elif path == "/api/trigger-cycle": clusters = analyze_clusters() if not clusters: discover_clusters(min_cluster_size=2) clusters = analyze_clusters(min_occurrenc ...[truncated 2925 chars]- Remediation
View remediation
Remediation Suggestions
- Bind the dashboard to
127.0.0.1by default and require an explicit configuration option for remote exposure. - Require strong authentication for every API endpoint, such as a securely generated bearer token or authenticated session.
- Enforce endpoint-specific authorization. Factory lifecycle operations should be restricted to an administrative role.
- Add CSRF protection if cookie-based browser authentication is used.
- Disable state-changing endpoints by default unless factory administration is explicitly enabled.
- Apply request size limits, rate limits, execution quotas, and schema validation to workload endpoints.
- Place the service behind TLS and a trusted reverse proxy when remote access is required.
- Return CORS headers only for explicitly trusted origins rather than using a wildcard.
- Bind the dashboard to
