CVE-2026-4408
Executive Summary
CVE-2026-4408 is a critical remote command execution vulnerability in Samba, affecting file servers and classic domain controllers that use the "check password script" feature. The flaw arises from improper sanitization of the %u substitution character, allowing an attacker to inject shell meta-characters via the client-controlled username. This can lead to full system compromise. The vulnerability has a CVSS score of 9.0 (Critical) and is currently unpatched. No public proof-of-concept or exploit code is available at this time.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
CVSS Breakdown & Threat Level
- CVSS Score: 9.0 (Critical)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: None (PR:N)
- User Interaction: None (UI:N)
- Scope: Unchanged (S:U)
- Confidentiality Impact: High (C:H)
- Integrity Impact: High (I:H)
- Availability Impact: High (A:H)
This vulnerability is extremely dangerous due to the lack of required privileges and user interaction, combined with high impact on all three security pillars.
Deep Dive & Mechanics
The vulnerability resides in the check password script feature of Samba, which is used in non-standard configurations to validate passwords via an external script. When the script is configured with the %u substitution character, the client-supplied username is inserted directly into a shell command without proper escaping. An attacker can craft a username containing shell meta-characters (e.g., ;, |, `, $()) to execute arbitrary commands on the Samba server.
The vulnerable code path is triggered when the samba-dcerpcd service is started as a system service and the check password script is defined in the Samba configuration. The attacker does not need valid credentials; they only need to send a malicious username during the authentication process.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
// Pseudocode for vulnerable implementation
char command[1024];
snprintf(command, sizeof(command), "/path/to/check_password %u", username);
system(command);
Patched Code (Conceptual):
// Pseudocode for patched implementation
char command[1024];
char escaped_username[1024];
escape_shell_metacharacters(username, escaped_username, sizeof(escaped_username));
snprintf(command, sizeof(command), "/path/to/check_password %u", escaped_username);
system(command);
The patched version uses a function to escape shell meta-characters before inserting the username into the command string.
Exploitation & Lab Setup
Red Team
Prerequisites:
- Samba server with
check password scriptconfigured using%u samba-dcerpcdrunning as a system service- Network access to the Samba service
Exploitation Steps:
- Identify a Samba server with the vulnerable configuration.
- Craft a malicious username containing shell commands, e.g.,
;id;. - Send an authentication request with the malicious username.
- The injected command executes on the server.
Example Payload:
# Using smbclient
smbclient -U ";id;%20" -L //target-ip
Note: No public exploit code is available. The above is a conceptual example.
Blue Team
Detection:
- Monitor Samba logs for unusual usernames containing shell meta-characters.
- Look for authentication attempts with usernames that include
;,|,`,$(), etc. - Alert on any execution of the
check password scriptwith suspicious arguments.
Hunting:
- Search for processes spawned by
samba-dcerpcdthat contain shell meta-characters. - Review system logs for unexpected command execution.
Indicators of Compromise (IOCs)
- Network: SMB authentication requests with usernames containing shell meta-characters.
- Host: Unusual processes spawned by
samba-dcerpcdor thecheck password script. - Logs: Samba logs showing authentication attempts with suspicious usernames.
- File System: Unexpected files created in
/tmpor other writable directories.
Detection Engineering
YARA Rule
rule CVE_2026_4408_Samba_CheckPasswordScript {
meta:
description = "Detects exploitation attempts of CVE-2026-4408 via shell meta-characters in Samba usernames"
author = "Valters IT"
date = "2026-01-01"
reference = "CVE-2026-4408"
strings:
$meta1 = /[;|`$(){}]/
$meta2 = /%u/
condition:
$meta1 and $meta2
}
Sigma Rule
title: Samba Check Password Script Exploitation Attempt
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects authentication attempts with shell meta-characters in username
author: Valters IT
logsource:
product: samba
service: smbd
detection:
selection:
username|contains:
- ';'
- '|'
- '`'
- '$('
- ')'
condition: selection
falsepositives:
- Legitimate usernames containing special characters (rare)
level: critical
Suricata Rule
alert tcp any any -> any 445 (msg:"CVE-2026-4408 Samba Check Password Script Exploitation"; flow:to_server,established; content:"|00|"; depth:1; content:"|2e|"; distance:0; within:1; content:"|00|"; distance:0; within:1; pcre:"/^[^\\x00]*[;|`$()]/R"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable the
check password scriptfeature if not required. - If the feature is necessary, ensure the script does not use the
%usubstitution character. - Restrict network access to Samba services using firewalls.
Long-term Fix:
- Apply the official patch from Samba when available.
- Upgrade to a patched version of Samba.
Workaround:
- Use a wrapper script that sanitizes the username before passing it to the
check password script.
Valters IT
Securing Digital Frontiers