Описание
Devtron Attributes API Unauthorized Access Leading to API Token Signing Key Leakage
Devtron Attributes API Unauthorized Access Leading to API Token Signing Key Leakage
Summary
This vulnerability exists in Devtron's Attributes API interface, allowing any authenticated user (including low-privileged CI/CD Developers) to obtain the global API Token signing key by accessing the /orchestrator/attributes?key=apiTokenSecret endpoint. After obtaining the key, attackers can forge JWT tokens for arbitrary user identities offline, thereby gaining complete control over the Devtron platform and laterally moving to the underlying Kubernetes cluster.
CWE Classification: CWE-862 (Missing Authorization)
Details
Vulnerability Mechanism
Devtron uses a JWT-based API Token mechanism for authentication. All API Tokens are signed using HMAC-SHA256 with the apiTokenSecret stored in the database. This key is exposed through the Attributes API, but the authorization check code for this API has been commented out, allowing any authenticated user to read it.
Source Code Analysis
Vulnerability Location: api/restHandler/AttributesRestHandlder.go:173-195
Key Usage: pkg/apiToken/ApiTokenSecretService.go:54-88
This key is used to sign and verify all Devtron API Tokens and is the core credential of the control plane.
PoC (Proof of Concept)
Environment Setup
Prerequisites
- Kubernetes cluster (v1.22+)
- kubectl configured
- Helm 3.x
- Python 3.x with PyJWT library
Step 1: Install Devtron
Step 2: Access Devtron Dashboard
Access http://127.0.0.1:8000 and login with admin account.
Exploitation Steps
Step 1: Obtain User Token
Login as a regular user and obtain token:
Actual Output Example:
Step 2: Exploit Vulnerability to Retrieve apiTokenSecret
Use the obtained token to access the unauthorized Attributes API:
Actual Output Example:
Step 3: Forge Admin JWT Token
Forge admin token using the leaked key:
Actual Output Example:
Step 4: Test Forged Token with Admin APIs
Use the forged token to access admin APIs:
Actual Output Example:
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
Option 2: Rotate API Token Secret
Option 3: Add API Gateway Filtering
Deploy an API Gateway in front of Devtron to filter sensitive requests to /orchestrator/attributes.
Credits
@b0b0haha (603571786@qq.com) @lixingquzhi(mayedoushidalao@163.com)
Пакеты
github.com/devtron-labs/devtron
<= 2.0.0
Отсутствует
Связанные уязвимости
Devtron is an open source tool integration platform for Kubernetes. In version 2.0.0 and prior, a vulnerability exists in Devtron's Attributes API interface, allowing any authenticated user (including low-privileged CI/CD Developers) to obtain the global API Token signing key by accessing the /orchestrator/attributes?key=apiTokenSecret endpoint. After obtaining the key, attackers can forge JWT tokens for arbitrary user identities offline, thereby gaining complete control over the Devtron platform and laterally moving to the underlying Kubernetes cluster. This issue has been patched via commit d2b0d26.