What Is Samba?
Samba is the open-source implementation of the SMB/CIFS protocol for Linux, Unix, and macOS, enabling file and print sharing with Windows networks. Samba runs on hundreds of millions of NAS devices, Linux servers, embedded systems, and cloud instances. Because Samba mediates file sharing between systems, a Samba server compromise gives access to all shared files and the underlying host OS. CVE-2017-7494 became known as "SambaCry" — named after EternalBlue/WannaCry — because it exploits a similar SMB-based attack vector to achieve remote code execution on Linux/Unix systems.
Overview
CVE-2017-7494 (SambaCry/EternalRed) is a critical remote code execution vulnerability in Samba (versions 3.5.0 through 4.6.3, 4.5.9, and 4.4.14). A malicious SMB client can upload a shared library to a writable Samba share and then cause the Samba server to load and execute the library — achieving code execution as the Samba daemon's process user (often root on NAS devices). The attack requires a writable file share and knowledge of the server-side path where the uploaded library lands. Fixed in Samba 4.6.4, 4.5.10, and 4.4.14 (May 2017). CISA added CVE-2017-7494 to the KEV catalog in March 2023, reflecting confirmed ransomware exploitation of Samba-based file servers.
Affected Versions
| Samba Version | Status |
|---|---|
| Samba 3.5.0 through 4.6.3 | Vulnerable |
| Samba 4.5.0 through 4.5.9 | Vulnerable |
| Samba 4.4.0 through 4.4.14 | Vulnerable |
| Samba 4.6.4, 4.5.10, 4.4.14 and later | Fixed |
Technical Details
Root Cause: Shared Library Loading from Writable Share
CVE-2017-7494 is a code injection vulnerability (CWE-434) exploiting Samba's pipe IPC mechanism. The attack chain:
- Writable share identified: Attacker finds or creates a Samba share with write access — either through anonymous write access, guest access, or valid credentials
- Shared library upload: Attacker uploads a malicious shared library (
.sofile) to the writable share via standard SMB file write operations - Server-side path determination: The attacker must know the absolute server-side filesystem path where the uploaded
.sofile is stored; this is often deterministic or discoverable via Samba information leakage - IPC pipe invocation: The attacker opens an IPC connection to Samba and requests a named pipe that matches the path of the uploaded
.sofile; Samba's pipe processing code callsdlopen()on the named pipe path, loading and executing the.soas a Samba module - Code execution: Library constructor functions execute in the context of the
smbdprocess — typically root on NAS devices, or file server user on Linux
Attack Characteristics
| Attribute | Detail |
|---|---|
| Attack Vector | Network — SMB (port 445) |
| Authentication | Requires writable share (often anonymous or guest on NAS) |
| Platform | Linux, Unix, NAS devices, embedded Samba |
| Impact | RCE as smbd process user (often root) |
| Named | SambaCry, EternalRed |
Discovery
Discovered by Stealth Mole and independently by others; Samba published the fix in May 2017. The nickname "SambaCry" was coined because the exploit was discovered in the immediate wake of the WannaCry/EternalBlue outbreak, sharing the Linux/NAS SMB exploitation theme.
Exploitation Context
- NAS cryptomining campaigns: Within days of the May 2017 patch, attackers launched automated campaigns targeting internet-facing Samba servers with writable shares — particularly NAS devices (Synology, QNAP, Western Digital) — deploying Monero cryptocurrency miners (SHELLBIND and EternalRed malware families)
- Ransomware targeting file servers: Samba file servers hold organizational file shares; ransomware operators specifically target Samba to encrypt network-accessible file stores, maximizing damage; CVE-2017-7494 provides initial access to Linux file servers that back Windows network shares
- NAS device persistence: NAS devices run Samba with root privileges and are rarely monitored with security tools; crypto-miners and backdoors installed via CVE-2017-7494 can persist for months
- Long exploitation tail: CISA's March 2023 KEV addition — nearly 6 years after the patch — reflects that Samba exploitation campaigns continued to be observed through 2023, particularly against unpatched NAS devices running EOL firmware
- CISA KEV (2023): Added March 30, 2023 following confirmed ransomware and cryptominer exploitation
Remediation
-
Upgrade Samba — update to Samba 4.6.4+, 4.5.10+, or 4.4.14+ to patch CVE-2017-7494; update NAS device firmware which includes the Samba update; use the OS package manager on Linux servers.
-
Add
nt pipe support = noas interim workaround — if immediate upgrade is not possible, add this to the[global]section ofsmb.confto disable the IPC pipe loading mechanism:nt pipe support = noNote: this may break certain client functionality.
-
Remove public/anonymous write access from shares — remove any anonymous or guest write permissions from Samba shares; require authentication for all write operations; CVE-2017-7494 exploitation requires writable share access.
-
Restrict Samba to the local network — block TCP port 445 at the internet perimeter; Samba should not be directly accessible from the internet; use a VPN or dedicated NAS management network for remote access.
-
Apply NAS firmware updates — NAS device vendors (Synology, QNAP, Western Digital, Netgear ReadyNAS) released firmware updates addressing CVE-2017-7494; apply the latest firmware for all NAS devices on the network.
Key Details
| Property | Value |
|---|---|
| CVE ID | CVE-2017-7494 |
| Vendor / Product | Samba — Samba |
| NVD Published | 2017-05-30 |
| NVD Last Modified | 2025-10-22 |
| CVSS 3.1 Score | 9.8 |
| CVSS 3.1 Vector | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| Severity | CRITICAL |
| CWE | CWE-434 — Unrestricted Upload of File with Dangerous Type find similar ↗ |
| CISA KEV Added | 2023-03-30 |
| CISA KEV Deadline | 2023-04-20 |
| Known Ransomware Use | ⚠️ Yes |
CVSS 3.1 Breakdown
Required Action
Timeline
| Date | Event |
|---|---|
| 2017-05-24 | Samba releases 4.6.4, 4.5.10, 4.4.14 patching CVE-2017-7494; exploit publicly named 'SambaCry' and 'EternalRed' |
| 2017-05-30 | CVE-2017-7494 published by NVD |
| 2017-06-01 | EternalRed/SHELLBIND exploitation of vulnerable Samba servers observed at scale; crypto-miners deployed |
| 2023-03-30 | Added to CISA Known Exploited Vulnerabilities catalog |
| 2023-04-20 | CISA BOD 22-01 remediation deadline |
References
| Resource | Type |
|---|---|
| NVD — CVE-2017-7494 | Vulnerability Database |
| CISA KEV Catalog Entry | US Government |
| Samba Security Advisory — CVE-2017-7494 | Vendor Advisory |