CVE-2026-4480· samba / samba· CWE-78
Samba Printing Subsystem - Remote Code Execution
A flaw was found in the Samba printing subsystem. Samba passes the client-controlled job description string to the command configured with the "print command" setting via the "%J" substitution character without escaping shell meta characters. A remote attacker could exploit this vulnerability by sending a specially crafted print job description that contains unescaped shell characters. This could lead to remote code execution on the affected system.
Impact
Successful exploitation allows an unauthenticated remote attacker to execute arbitrary operating system commands on the Samba server, leading to full system compromise including data exfiltration, malware deployment, and lateral movement within the network.
Fix
Upgrade Samba to version 4.22.10, 4.23.8, or 4.24.3 or later, or as a workaround add single quotes directly around %J in the print command smb.conf entry or remove %J completely from the configuration.
How to confirm it
Positive when: contains "Samba" AND compare_versions(version, '< 4.22.10') || compare_versions(version, '>= 4.23.0', '< 4.23.8') || compare_versions(version, '>= 4.24.0', '< 4.24.3')Run it with nuclei: nuclei -id CVE-2026-4480 -u <target>. This check is not marked as verified by its authors.
The full check
id: CVE-2026-4480
info:
name: Samba Printing Subsystem - Remote Code Execution
author: projectdiscovery
severity: critical
description: |
A flaw was found in the Samba printing subsystem. Samba passes the client-controlled job description string to the command configured with the "print command" setting via the "%J" substitution character without escaping shell meta characters. A remote attacker could exploit this vulnerability by sending a specially crafted print job description that contains unescaped shell characters. This could lead to remote code execution on the affected system.
impact: |
Successful exploitation allows an unauthenticated remote attacker to execute arbitrary operating system commands on the Samba server, leading to full system compromise including data exfiltration, malware deployment, and lateral movement within the network.
remediation: |
Upgrade Samba to version 4.22.10, 4.23.8, or 4.24.3 or later, or as a workaround add single quotes directly around %J in the print command smb.conf entry or remove %J completely from the configuration.
reference:
- https://github.com/Vusal777/CVE-2026-4480-exploit-poc
- https://www.samba.org/samba/security/CVE-2026-4480.html
- https://nvd.nist.gov/vuln/detail/CVE-2026-4480
classification:
cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
cvss-score: 9.8
cve-id: CVE-2026-4480
epss-score: 0.28691
epss-percentile: 0.98156
cwe-id: CWE-78
metadata:
max-request: 1
vendor: samba
product: samba
shodan-query: "port:445 product:Samba"
fofa-query: "protocol=smb && banner=Samba"
tags: cve,cve2026,samba,rce,smb,printing,passive,vkev
javascript:
- pre-condition: |
isPortOpen(Host,Port);
code: |
let m = require("nuclei/smb");
let c = new m.SMBClient();
let response = c.ConnectSMBInfoMode(Host, Port);
to_json(response);
args:
Host: "{{Host}}"
Port: "445"
matchers-condition: and
matchers:
- type: word
words:
- "Samba"
- type: dsl
dsl:
- "compare_versions(version, '< 4.22.10') || compare_versions(version, '>= 4.23.0', '< 4.23.8') || compare_versions(version, '>= 4.24.0', '< 4.24.3')"
extractors:
- type: regex
name: version
group: 1
regex:
- "Samba ([0-9]+\\.[0-9]+\\.[0-9]+[a-z]*)"References
- https://github.com/Vusal777/CVE-2026-4480-exploit-poc
- https://www.samba.org/samba/security/CVE-2026-4480.html
- https://nvd.nist.gov/vuln/detail/CVE-2026-4480
Use this check only on systems you are authorised to test. Where the data comes from