GHSA-j8hf-cp34-g4j7 Dragonfly Manager Job API Unauthenticated Access
SummaryDragonfly Manager's Job REST API endpoints lack authentication, allowing unauthenticated attackers to create, query, modify, and delete jobs, potentially leading to resource exhaustion, information disclosure, and service disruption.Affected Products**Product**: Dragonfly**Component**: Manager (REST API)**Affected Versions**: v2.x (based on source code analysis, including v2.4.0)**Affected Endpoints**: `/api/v1/jobs`Vulnerability DetailsDescriptionDragonfly Manager's Job API endpoints (`/api/v1/jobs`) lack JWT authentication middleware and RBAC authorization checks in the routing configuration. This allows any unauthenticated user with access to the Manager API to perform the following operations:**List all jobs** (GET `/api/v1/jobs`)**Create new jobs** (POST `/api/v1/jobs`)**Query job details** (GET `/api/v1/jobs/:id`)**Modify jobs** (PATCH `/api/v1/jobs/:id`)**Delete jobs** (DELETE `/api/v1/jobs/:id`)Technical Root CauseIn the source code file `manager/router/router.go` at lines 204-211, the Job API route group lacks authentication middleware:In contrast, other API endpoints (such as `/clusters`) are correctly configured with authentication:The developer left a TODO comment in the code, indicating this is a known but unresolved issue.Proof of ConceptEnvironment SetupPrerequisitesKubernetes cluster (Kind/Minikube/GKE, etc.)Helm 3.8.0+kubectlcurl and jqDeployment Steps**Add Dragonfly Helm Repository****Generate Deployment Manifest****Deploy to Kubernetes****Expected Output**:**Setup Port Forwarding**Exploitation StepsStep 1: Verify Unauthenticated Access**Command**:**Actual Output**:**HTTP Status Code**: `200 OK`**Analysis**: The API returns a successful response instead of `401 Unauthorized`, confirming the lack of authentication.Step 2: Create Unauthorized Job**Command**:**Actual Output**:**HTTP Status Code**: `200 OK`**Analysis**: Successfully created a Job (ID: 2) without any authentication token.Step 3: Query Job Details**Command**:**Actual Output**:**HTTP Status Code**: `200 OK`Step 4: Modify Job**Command**:**Actual Output**:**HTTP Status Code**: `200 OK`Step 5: Delete Job**Command**:**Actual Output**:**HTTP Status Code**: `200 OK`Step 6: Comparison Test - Authenticated Endpoint**Command**:**Actual Output**:**HTTP Status Code**: `401 Unauthorized`**Analysis**: This proves that the authentication mechanism itself is working correctly; only the Job API endpoints are missing the configuration.Automated POC ScriptComplete automated verification script available at:Script: `poc.sh`Output Log: `poc_output.log`**Execution Summary**:Impact AnalysisDirect Impact**Unauthorized Job Management**: Attackers can fully control the Job lifecycle (CRUD operations)**Information Disclosure**: Can query all jobs, potentially exposing internal URLs, configurations, and business logic**Service Disruption**: Can delete legitimate jobs, affecting normal file distribution services**Resource Exhaustion**: Can create massive numbers of jobs leading to system resource exhaustion (DoS)Potential Attack Scenarios**Resource Exhaustion Attack****SSRF Risk**: Through the URL parameter of Preheat jobs, SSRF attacks may be triggered (although there is SafeDialer protection, risks still exist)**Business Logic Disruption**: Delete or modify critical jobs, affecting CDN preheating and file distribution functionalityAffected Deployment ScenariosManager API exposed on the public internet or untrusted networksMalicious users or compromised systems in internal networksTenant isolation failures in multi-tenant environmentsRemediationRecommended FixAdd authentication and authorization middleware to the Job API in the `manager/router/router.go` file:Temporary MitigationBefore the fix is released, the following mitigation measures can be taken:**Network Isolation**: Restrict network access to the Manager APIUse firewall rules to limit source IPsOnly allow trusted internal networks to accessUse Kubernetes NetworkPolicy to restrict Pod-to-Pod communication**API Gateway**: Deploy an API gateway in front of Manager for authenticationUse reverse proxies like Nginx/Kong/TraefikConfigure OAuth2/JWT validation**Monitoring and Alerting**: Monitor abnormal access patterns to Job APILog all Job API callsSet up alerts for abnormal job creation/deletionVerify FixAfter the fix, all unauthenticated requests should return `401 Unauthorized`:**Expected Output**:Appendix: Complete Verification LogsDeployment Verification LogsPOC Execution Complete LogsSee `poc_output.log` file for details.PatchesDragonfy v2.4.1 and above.WorkaroundsThere are no effective workarounds, beyond upgrading.
CVSS v4.0 score: 8.9