SpiderLabs Blog

What We Know So Far About Zero-Day CUPS Vulnerabilities: CVE-2024-47176, CVE-2024-47076, CVE-2024-47175, and CVE-2024-47177

Written by | Sep 30, 2024 6:54:40 PM

On September 26, 2024, security researcher Simone Margaritellidisclosed the details of four OpenPrinting Common UNIX Printing System (CUPS) vulnerabilities, that, when chained together, can allow malicious actors to launch remote code execution (RCE) attacks on vulnerable systems.

CUPS is a widely used, open-source printing system that supports Linux and other Unix-like operating systems. It also supports ChromeOS and macOS.

 

An Overview of CVE-2024-47176, CVE-2024-47076, CVE-2024-47175, and CVE-2024-4717

As of writing, one of the four CUPS zero-day vulnerabilities received a critical severity score, while the rest have high severity ratings. Details of the vulnerabilities are as follows:

  • CVE-2024-47176: An Improper Input Validation, Binding to an Unrestricted IP Address, and Exposed Dangerous Method or Function vulnerability that affects the `cups-browsed` daemon by binding to `INADDR_ANY:631`. When this happens, it trusts any packet from any source and can trigger a `Get-Printer-Attributes` Internet Printing Protocol (IPP) request to an attacker-controlled URL.
    • CVSS 3.x Severity Rating: 8.3 High
      Affected Version: 2.0.1 and below
  • CVE-2024-47076: An Improper Input Validation vulnerability that affects the `cfGetPrinterAttributes5`function in the `libcupsfilters` component, which does not validate or sanitize the IPP attributes returned from an IPP server. For example, when these IPP attributes are used to generate a Postscript Printer Description (PPD) file, it can lead to attacker-controlled data being provided to the rest of the CUPS system.
    • CVSS 3.x Severity Rating: 8.6 High
      Affected Version: 2.1b1 and below
  • CVE-2024-47175: An Improper Input Validation vulnerability that affects the `ppdCreatePPDFromIPP2` function in the `libppd` library package. Because of this flaw, IPP attributes are not sanitized before being written to a temporary PPD file, which can result in an attacker injecting malicious data into the PPD file. When the `ppdCreatePPDFromIPP2` function is combined with other functions such as `cfGetPrinterAttributes5`, it can result in user-controlled input and code execution via Foomatic , a database-driven system that can be used to integrate free software printer drivers with the CUPS system. RCE is possible when this bug is part of an exploit chain.
    • CVSS 3.x Severity Rating: 8.6 High
      Affected Version: 2.1b1 and below
  • CVE-2024-47177: An Improper Neutralization of Special Elements used in a Command ('Command Injection') vulnerability that affects the `FoomaticRIPCommandLine` parameter of the cups-filters library. Any value passed onto the `FoomaticRIPCommandLine` attribute via a PPD file can allow malicious actors to execute arbitrary commands. RCE is possible when this bug is combined with other logic bugs.
    • CVSS 3.x Severity Rating: 9.0 Critical
      Affected Version: 2.0.1 and below

Red Hat details the attack chain of how malicious actors can exploit these vulnerabilities in its blog post.

Regarding these vulnerabilities’ CVSS scores, it should be noted that initially, Margaritelli tweeted that “Canonical, RedHat and others have confirmed the severity, a 9.9,” for at least one of the CUPS flaws and shared a supporting screenshot from a Red Hat engineer who estimated the score.

However, as of publishing, the highest CVSS rating is at 9.0. On September 27, 2024, Red Hat published a security bulletin regarding these CUPS vulnerabilities where they shared that “these issues are rated with a severity impact of Important, and in their default configuration are not vulnerable.”

 

Protecting Your Systems From CVE-2024-47176, CVE-2024-47076, CVE-2024-47175, and CVE-2024-4717

It is important to note that while most Linux systems come with CUPS, it is atypical for systems to have the `cups-browsed` service enabled, as it is, by default, disabled. The `cups-browsed` daemon must be manually enabled to expose a targeted system’s UDP ports on a network.

Additionally, a malicious actor looking to exploit this vulnerability must also find a way to trick users into triggering a print job from a malicious printer server on their local network.

Although patches for these bugs are still unavailable as of writing, Margaritelli recommends the following security best practices:

  • If unneeded, disable and remove the `cups-browsed` service.
  • Update the CUPS package on your systems.
  • If a system update is not possible, block all traffic to UDP port 631 and possibly all DNS-SD traffic (this does not apply to zeroconf).

Trustwave will continue to monitor this developing situation, and we remain on standby for our clients to provide further details as more information becomes available.