---
title: "Samba Print Command RCE (CVE-2026-4480)"
canonical: https://trickest.com/library/samba-print-command-cve-2026-4480
description: "A configuration-side page for the Samba print command injection in CVE-2026-4480: the %J substitution passes a job name to the shell unescaped."
---

# Samba Print Command RCE (CVE-2026-4480)

## Overview

This page covers CVE-2026-4480, the Samba command injection in the printing subsystem, and its honest detection story is configuration-side: there is nothing useful to probe remotely, because the bug fires only where a legacy printer-sharing setup sets a print command, and modern Samba defaults do not. Where the configuration exists, the client-controlled print job description reaches the configured command through the %J substitution without escaping shell metacharacters, so a crafted job name executes arbitrary commands as the Samba process user. That configuration gate is why Red Hat scores 9.0 while NVD carries 9.8, and this page keeps both numbers with the reasoning. Fixed packages ship through the Red Hat errata and equivalent vendor updates, and the version gate is the distro package, not upstream semver. The page walks the configuration review that decides exposure, feeding [exposure management](/use-cases/exposure-management) from the host side.

## Pipeline

1. Inventory Samba servers in the estate, then grep smb.conf for print command, lpq command, and the spoolss printing path: a configuration with none of these is not reachable by this bug, and that is the finding most modern estates will produce.
2. Where a print command exists, treat every server running it as exposed until updated: the job-description string is fully client-controlled, so any user who can submit a print job reaches the shell.
3. Check network reachability of the SMB service on 445 and 139 for the affected servers, because an internally reachable print server and an internet-exposed one are different response urgencies.
4. Gate the version on the distro package, not upstream releases: Red Hat errata RHSA-2026:22644, RHSA-2026:22963, and RHSA-2026:25049 name the fixed package versions, and equivalent vendor errata apply elsewhere.
5. Update the affected servers and re-verify that the running package matches the fixed one, since an installed-but-not-restarted Samba is the classic gap.

## Inputs

- **Samba inventory.** Server addresses and their smb.conf files, or the configuration review authority for the estate.

## Outputs

- No workflow run produces output on this page. The deliverable is a documented configuration decision: no print command anywhere, or updated packages everywhere a print command still exists.

## Sample output

The transcript below is illustrative and does not come from a real run. It shows the configuration evidence an operator collects while triaging.

```console
$ testparm -s 2>/dev/null | grep -iE 'print command|printing ='
	printing = cups
	print command = /usr/bin/lpr -P%p %s; rm %s
$ rpm -q samba
samba-4.19.4-3.el9.x86_64
```

## FAQ

### Why no scan for this one?

Because a remote probe that proves the bug is a print job whose description carries shell metacharacters, which is already the exploit executed on the target. The honest check is reading smb.conf, which needs no exploit at all and answers the question completely.

### Why do the two scores disagree?

NVD scores 9.8 by treating the print path as default; Red Hat scores 9.0 because exploitation requires a print command configuration that modern Samba does not set. This page keeps both and explains the gate, which is the honest summary.

### Who can exploit it where the configuration exists?

Anyone who can submit a print job to the affected share, with the commands running as the Samba process user. That makes an internally reachable print server with print command configured a real risk from any compromised workstation, not just from the internet.

### Which versions are affected?

The affected distro lines carry it, fixed by the Red Hat errata and equivalent vendor updates. Compare distro package versions, not upstream semver, because backports do not move the upstream version string.

## Related workflows

- [Gitea Diffpatch RCE (CVE-2026-60004)](/library/gitea-diffpatch-rce-check-cve-2026-60004). Reach for it when the next infrastructure flag is a Git platform instead of a file server.
- [Idunno.AntiCsrf RCE Exposure (CVE-2026-131914)](/library/idunno-anticsrf-exposure-check-cve-2026-131914). Reach for it when the next no-fix-or-config-gated flag is a web stack.
- [Full Network Port and Service Assessment](/library/full-network-port-and-service-assessment). Map which hosts expose SMB across the estate first.

---
_Markdown source of https://trickest.com/library/samba-print-command-cve-2026-4480._
