深度挖掘:浏览 GNU-Linux 系统中的关键 CUPS 漏洞
最近,Linux 用户的日子并不好过,据报道,在过去几年中,有几个高严重性漏洞以各种方式影响着该系统。
2024 年 9 月 27 日,evasocket.net 的 Simone Margaritelli发布了有关 CUPS 中几个可利用漏洞的重要信息,并随后为其中四个漏洞分配了 CVE。这个数字可能还会增加,但在撰写本文时,安全社区还在争论这些发现的实际严重性。虽然其中一个 CVE(CVE-2024-47177)目前被 MITRE 评为 9.1 级严重程度,但成功利用这个命令注入漏洞依赖于启用了 CUPS 服务的服务器,此外还需要访问 UDP 端口 631 或 DNS-SD。不过RedHat指出,可以将 CUPS 重新映射到其他端口。
Margaritelli 对这一事件进行了全面的分析,揭示了一个阴险、复杂的攻击链,尽管社区存在分歧,但这一攻击链不容忽视。它给我们上了一堂课,让我们了解到,如果威胁行为者足够果断,如果糟糕的编码模式留下了可乘之机,看似无害的依赖关系也会被深度利用。
CUPS 场景与许多开发人员和 AppSec 专业人员以前可能经历过的场景有些不同,让我们一起来看看,顺便测试一下你的技能。
漏洞:通过 CUPS 远程执行代码 (RCE)
Evilsocket 博客提供了有关这些漏洞的无与伦比的详尽背景资料,我们将继续密切关注这一资源。Margaritelli 还在文章中引用了一位不愿透露姓名的消息人士的话,他似乎对 Linux 的总体安全性并不乐观:
"从通用安全的角度来看,如今的整个 Linux 系统就是一个无穷无尽、毫无希望的安全漏洞大杂烩,等着被人利用。"
这令人清醒地意识到开源环境中仍然普遍存在的固有安全风险,更不用说全球开发社区对提高安全意识和安全编码技能的迫切需要了。
让我们来看看 CVEs:
该漏洞链非常广泛,目前影响到以下软件包的所有当前和先前版本:
- Distrotech/cups-filters
- OpenPrinting/cups-filters
- 浏览杯子
- libcupsfilters
- libppd
二十多年来,CUPS 一直是 UNIX 和 Linux 操作系统的传统组件。它作为打印服务依赖程序的功能使其急于执行网络请求,成为 RCE 类漏洞的主要攻击目标。
不过,在这种情况下,如何将攻击巧妙地结合在一起并取得成功结果,还是有一些独到之处的。这主要是指未经身份验证、未被发现的攻击者可以用恶意 URL 替换 Internet 打印协议 (IPP) URL,此外还可以修改指令,从而在 "PPD(PostScript 打印机描述)文件"(该文件用于描述新添加打印机的功能)中造成命令注入。一旦打印任务被激活,就会导致命令执行攻击,而这依赖于 CUPS 组件中缺乏输入验证。
此外,正如 Evilsocket指出的那样,修复这一特定漏洞是一把双刃剑。CUPS 包括 foomatic-rip 过滤器,这个可执行文件以前曾是一个高风险、可被利用的组件。与该组件相关的 CVE 可以追溯到 2011 年,虽然已经确定 foomatic-rip 可以被用来执行操作系统命令,但修复该漏洞会导致稳定性问题,并失去对许多旧版打印机的支持。这是一个需要克服的复杂问题。

- 威胁方发起攻击
- CVE-2024-47176: cups-browsed <= 2.0.1 is vulnerable because it binds to UDP port 631 using INADDR_ANY, which means it trusts any packet received from any source. This allows an unauthenticated remote attacker to send a malicious UDP packet with a manipulated IPP URL (pointing to the attacker-controlled IPP server), triggering the vulnerability. The victim’s machine now thinks it’s connecting to a new printer and sends a request asking for printer attributes.
- 受害者系统处理打印机属性
- CVE-2024-47076: libcupsfilters <= 2.1b1 has a vulnerability in cfGetPrinterAttributes5, which does not properly validate or sanitize the IPP attributes returned from an IPP server. When cups-browsed processes the packet, it can be tricked into reading malicious attributes sent by the attacker.
- 受害者系统连接到攻击者控制的 IPP 服务器
- CVE-2024-47175: libppd <= 2.1b1 in the ppdCreatePPDFromIPP2 function does not properly validate or sanitize IPP attributes when saving them to a temporary PPD (PostScript Printer Description) file. This allows the attacker to inject arbitrary data into a PPD file, including the FoomaticRIPCommandLine directive, which the printing system can later execute.
- Victim system initiates print job and attacker’s code is executed
CVE-2024-47177: cups-filters <= 2.0.1 is vulnerable because the foomatic-rip filter executes arbitrary commands through the FoomaticRIPCommandLine directive, allowing the attacker to run commands as the cups-browsed process. The attacker waits for the victim’s machine to initiate a print job. The moment this happens, the attacker’s malicious code will be executed (Remote Code Execution).
如何降低 RCE 风险?
对于使用 CUPS 作为业务运营一部分的公司,必须遵循Evilsocket和RedHat 建议的修复建议。这包括但不限于作为紧急优先事项应用安全补丁。
有关命令注入的一般信息,请查看我们的综合指南。
如果您有兴趣获得更多免费的编码指南,请查看Secure Code Coach,它可以帮助您掌握安全编码的最佳实践。


当我们探索通用 UNIX 打印系统 (CUPS) 中最近出现的高严重性漏洞时,发现 Linux 用户面临的最新安全挑战。了解这些问题如何可能导致潜在的远程代码执行 (RCE),以及如何保护您的系统。

Secure Code Warrior 我们在这里为您的组织提供服务,帮助您在整个软件开发生命周期中确保代码安全,并创造一种将网络安全放在首位的文化。无论您是应用安全经理、开发人员、CISO或任何涉及安全的人,我们都可以帮助您的组织减少与不安全代码有关的风险。
预定一个演示Laura Verheyde 是Secure Code Warrior 的一名软件开发人员,主要负责研究漏洞并为Missions 和编码实验室创建内容。


最近,Linux 用户的日子并不好过,据报道,在过去几年中,有几个高严重性漏洞以各种方式影响着该系统。
2024 年 9 月 27 日,evasocket.net 的 Simone Margaritelli发布了有关 CUPS 中几个可利用漏洞的重要信息,并随后为其中四个漏洞分配了 CVE。这个数字可能还会增加,但在撰写本文时,安全社区还在争论这些发现的实际严重性。虽然其中一个 CVE(CVE-2024-47177)目前被 MITRE 评为 9.1 级严重程度,但成功利用这个命令注入漏洞依赖于启用了 CUPS 服务的服务器,此外还需要访问 UDP 端口 631 或 DNS-SD。不过RedHat指出,可以将 CUPS 重新映射到其他端口。
Margaritelli 对这一事件进行了全面的分析,揭示了一个阴险、复杂的攻击链,尽管社区存在分歧,但这一攻击链不容忽视。它给我们上了一堂课,让我们了解到,如果威胁行为者足够果断,如果糟糕的编码模式留下了可乘之机,看似无害的依赖关系也会被深度利用。
CUPS 场景与许多开发人员和 AppSec 专业人员以前可能经历过的场景有些不同,让我们一起来看看,顺便测试一下你的技能。
漏洞:通过 CUPS 远程执行代码 (RCE)
Evilsocket 博客提供了有关这些漏洞的无与伦比的详尽背景资料,我们将继续密切关注这一资源。Margaritelli 还在文章中引用了一位不愿透露姓名的消息人士的话,他似乎对 Linux 的总体安全性并不乐观:
"从通用安全的角度来看,如今的整个 Linux 系统就是一个无穷无尽、毫无希望的安全漏洞大杂烩,等着被人利用。"
这令人清醒地意识到开源环境中仍然普遍存在的固有安全风险,更不用说全球开发社区对提高安全意识和安全编码技能的迫切需要了。
让我们来看看 CVEs:
该漏洞链非常广泛,目前影响到以下软件包的所有当前和先前版本:
- Distrotech/cups-filters
- OpenPrinting/cups-filters
- 浏览杯子
- libcupsfilters
- libppd
二十多年来,CUPS 一直是 UNIX 和 Linux 操作系统的传统组件。它作为打印服务依赖程序的功能使其急于执行网络请求,成为 RCE 类漏洞的主要攻击目标。
不过,在这种情况下,如何将攻击巧妙地结合在一起并取得成功结果,还是有一些独到之处的。这主要是指未经身份验证、未被发现的攻击者可以用恶意 URL 替换 Internet 打印协议 (IPP) URL,此外还可以修改指令,从而在 "PPD(PostScript 打印机描述)文件"(该文件用于描述新添加打印机的功能)中造成命令注入。一旦打印任务被激活,就会导致命令执行攻击,而这依赖于 CUPS 组件中缺乏输入验证。
此外,正如 Evilsocket指出的那样,修复这一特定漏洞是一把双刃剑。CUPS 包括 foomatic-rip 过滤器,这个可执行文件以前曾是一个高风险、可被利用的组件。与该组件相关的 CVE 可以追溯到 2011 年,虽然已经确定 foomatic-rip 可以被用来执行操作系统命令,但修复该漏洞会导致稳定性问题,并失去对许多旧版打印机的支持。这是一个需要克服的复杂问题。

- 威胁方发起攻击
- CVE-2024-47176: cups-browsed <= 2.0.1 is vulnerable because it binds to UDP port 631 using INADDR_ANY, which means it trusts any packet received from any source. This allows an unauthenticated remote attacker to send a malicious UDP packet with a manipulated IPP URL (pointing to the attacker-controlled IPP server), triggering the vulnerability. The victim’s machine now thinks it’s connecting to a new printer and sends a request asking for printer attributes.
- 受害者系统处理打印机属性
- CVE-2024-47076: libcupsfilters <= 2.1b1 has a vulnerability in cfGetPrinterAttributes5, which does not properly validate or sanitize the IPP attributes returned from an IPP server. When cups-browsed processes the packet, it can be tricked into reading malicious attributes sent by the attacker.
- 受害者系统连接到攻击者控制的 IPP 服务器
- CVE-2024-47175: libppd <= 2.1b1 in the ppdCreatePPDFromIPP2 function does not properly validate or sanitize IPP attributes when saving them to a temporary PPD (PostScript Printer Description) file. This allows the attacker to inject arbitrary data into a PPD file, including the FoomaticRIPCommandLine directive, which the printing system can later execute.
- Victim system initiates print job and attacker’s code is executed
CVE-2024-47177: cups-filters <= 2.0.1 is vulnerable because the foomatic-rip filter executes arbitrary commands through the FoomaticRIPCommandLine directive, allowing the attacker to run commands as the cups-browsed process. The attacker waits for the victim’s machine to initiate a print job. The moment this happens, the attacker’s malicious code will be executed (Remote Code Execution).
如何降低 RCE 风险?
对于使用 CUPS 作为业务运营一部分的公司,必须遵循Evilsocket和RedHat 建议的修复建议。这包括但不限于作为紧急优先事项应用安全补丁。
有关命令注入的一般信息,请查看我们的综合指南。
如果您有兴趣获得更多免费的编码指南,请查看Secure Code Coach,它可以帮助您掌握安全编码的最佳实践。

最近,Linux 用户的日子并不好过,据报道,在过去几年中,有几个高严重性漏洞以各种方式影响着该系统。
2024 年 9 月 27 日,evasocket.net 的 Simone Margaritelli发布了有关 CUPS 中几个可利用漏洞的重要信息,并随后为其中四个漏洞分配了 CVE。这个数字可能还会增加,但在撰写本文时,安全社区还在争论这些发现的实际严重性。虽然其中一个 CVE(CVE-2024-47177)目前被 MITRE 评为 9.1 级严重程度,但成功利用这个命令注入漏洞依赖于启用了 CUPS 服务的服务器,此外还需要访问 UDP 端口 631 或 DNS-SD。不过RedHat指出,可以将 CUPS 重新映射到其他端口。
Margaritelli 对这一事件进行了全面的分析,揭示了一个阴险、复杂的攻击链,尽管社区存在分歧,但这一攻击链不容忽视。它给我们上了一堂课,让我们了解到,如果威胁行为者足够果断,如果糟糕的编码模式留下了可乘之机,看似无害的依赖关系也会被深度利用。
CUPS 场景与许多开发人员和 AppSec 专业人员以前可能经历过的场景有些不同,让我们一起来看看,顺便测试一下你的技能。
漏洞:通过 CUPS 远程执行代码 (RCE)
Evilsocket 博客提供了有关这些漏洞的无与伦比的详尽背景资料,我们将继续密切关注这一资源。Margaritelli 还在文章中引用了一位不愿透露姓名的消息人士的话,他似乎对 Linux 的总体安全性并不乐观:
"从通用安全的角度来看,如今的整个 Linux 系统就是一个无穷无尽、毫无希望的安全漏洞大杂烩,等着被人利用。"
这令人清醒地意识到开源环境中仍然普遍存在的固有安全风险,更不用说全球开发社区对提高安全意识和安全编码技能的迫切需要了。
让我们来看看 CVEs:
该漏洞链非常广泛,目前影响到以下软件包的所有当前和先前版本:
- Distrotech/cups-filters
- OpenPrinting/cups-filters
- 浏览杯子
- libcupsfilters
- libppd
二十多年来,CUPS 一直是 UNIX 和 Linux 操作系统的传统组件。它作为打印服务依赖程序的功能使其急于执行网络请求,成为 RCE 类漏洞的主要攻击目标。
不过,在这种情况下,如何将攻击巧妙地结合在一起并取得成功结果,还是有一些独到之处的。这主要是指未经身份验证、未被发现的攻击者可以用恶意 URL 替换 Internet 打印协议 (IPP) URL,此外还可以修改指令,从而在 "PPD(PostScript 打印机描述)文件"(该文件用于描述新添加打印机的功能)中造成命令注入。一旦打印任务被激活,就会导致命令执行攻击,而这依赖于 CUPS 组件中缺乏输入验证。
此外,正如 Evilsocket指出的那样,修复这一特定漏洞是一把双刃剑。CUPS 包括 foomatic-rip 过滤器,这个可执行文件以前曾是一个高风险、可被利用的组件。与该组件相关的 CVE 可以追溯到 2011 年,虽然已经确定 foomatic-rip 可以被用来执行操作系统命令,但修复该漏洞会导致稳定性问题,并失去对许多旧版打印机的支持。这是一个需要克服的复杂问题。

- 威胁方发起攻击
- CVE-2024-47176: cups-browsed <= 2.0.1 is vulnerable because it binds to UDP port 631 using INADDR_ANY, which means it trusts any packet received from any source. This allows an unauthenticated remote attacker to send a malicious UDP packet with a manipulated IPP URL (pointing to the attacker-controlled IPP server), triggering the vulnerability. The victim’s machine now thinks it’s connecting to a new printer and sends a request asking for printer attributes.
- 受害者系统处理打印机属性
- CVE-2024-47076: libcupsfilters <= 2.1b1 has a vulnerability in cfGetPrinterAttributes5, which does not properly validate or sanitize the IPP attributes returned from an IPP server. When cups-browsed processes the packet, it can be tricked into reading malicious attributes sent by the attacker.
- 受害者系统连接到攻击者控制的 IPP 服务器
- CVE-2024-47175: libppd <= 2.1b1 in the ppdCreatePPDFromIPP2 function does not properly validate or sanitize IPP attributes when saving them to a temporary PPD (PostScript Printer Description) file. This allows the attacker to inject arbitrary data into a PPD file, including the FoomaticRIPCommandLine directive, which the printing system can later execute.
- Victim system initiates print job and attacker’s code is executed
CVE-2024-47177: cups-filters <= 2.0.1 is vulnerable because the foomatic-rip filter executes arbitrary commands through the FoomaticRIPCommandLine directive, allowing the attacker to run commands as the cups-browsed process. The attacker waits for the victim’s machine to initiate a print job. The moment this happens, the attacker’s malicious code will be executed (Remote Code Execution).
如何降低 RCE 风险?
对于使用 CUPS 作为业务运营一部分的公司,必须遵循Evilsocket和RedHat 建议的修复建议。这包括但不限于作为紧急优先事项应用安全补丁。
有关命令注入的一般信息,请查看我们的综合指南。
如果您有兴趣获得更多免费的编码指南,请查看Secure Code Coach,它可以帮助您掌握安全编码的最佳实践。
最近,Linux 用户的日子并不好过,据报道,在过去几年中,有几个高严重性漏洞以各种方式影响着该系统。
2024 年 9 月 27 日,evasocket.net 的 Simone Margaritelli发布了有关 CUPS 中几个可利用漏洞的重要信息,并随后为其中四个漏洞分配了 CVE。这个数字可能还会增加,但在撰写本文时,安全社区还在争论这些发现的实际严重性。虽然其中一个 CVE(CVE-2024-47177)目前被 MITRE 评为 9.1 级严重程度,但成功利用这个命令注入漏洞依赖于启用了 CUPS 服务的服务器,此外还需要访问 UDP 端口 631 或 DNS-SD。不过RedHat指出,可以将 CUPS 重新映射到其他端口。
Margaritelli 对这一事件进行了全面的分析,揭示了一个阴险、复杂的攻击链,尽管社区存在分歧,但这一攻击链不容忽视。它给我们上了一堂课,让我们了解到,如果威胁行为者足够果断,如果糟糕的编码模式留下了可乘之机,看似无害的依赖关系也会被深度利用。
CUPS 场景与许多开发人员和 AppSec 专业人员以前可能经历过的场景有些不同,让我们一起来看看,顺便测试一下你的技能。
漏洞:通过 CUPS 远程执行代码 (RCE)
Evilsocket 博客提供了有关这些漏洞的无与伦比的详尽背景资料,我们将继续密切关注这一资源。Margaritelli 还在文章中引用了一位不愿透露姓名的消息人士的话,他似乎对 Linux 的总体安全性并不乐观:
"从通用安全的角度来看,如今的整个 Linux 系统就是一个无穷无尽、毫无希望的安全漏洞大杂烩,等着被人利用。"
这令人清醒地意识到开源环境中仍然普遍存在的固有安全风险,更不用说全球开发社区对提高安全意识和安全编码技能的迫切需要了。
让我们来看看 CVEs:
该漏洞链非常广泛,目前影响到以下软件包的所有当前和先前版本:
- Distrotech/cups-filters
- OpenPrinting/cups-filters
- 浏览杯子
- libcupsfilters
- libppd
二十多年来,CUPS 一直是 UNIX 和 Linux 操作系统的传统组件。它作为打印服务依赖程序的功能使其急于执行网络请求,成为 RCE 类漏洞的主要攻击目标。
不过,在这种情况下,如何将攻击巧妙地结合在一起并取得成功结果,还是有一些独到之处的。这主要是指未经身份验证、未被发现的攻击者可以用恶意 URL 替换 Internet 打印协议 (IPP) URL,此外还可以修改指令,从而在 "PPD(PostScript 打印机描述)文件"(该文件用于描述新添加打印机的功能)中造成命令注入。一旦打印任务被激活,就会导致命令执行攻击,而这依赖于 CUPS 组件中缺乏输入验证。
此外,正如 Evilsocket指出的那样,修复这一特定漏洞是一把双刃剑。CUPS 包括 foomatic-rip 过滤器,这个可执行文件以前曾是一个高风险、可被利用的组件。与该组件相关的 CVE 可以追溯到 2011 年,虽然已经确定 foomatic-rip 可以被用来执行操作系统命令,但修复该漏洞会导致稳定性问题,并失去对许多旧版打印机的支持。这是一个需要克服的复杂问题。

- 威胁方发起攻击
- CVE-2024-47176: cups-browsed <= 2.0.1 is vulnerable because it binds to UDP port 631 using INADDR_ANY, which means it trusts any packet received from any source. This allows an unauthenticated remote attacker to send a malicious UDP packet with a manipulated IPP URL (pointing to the attacker-controlled IPP server), triggering the vulnerability. The victim’s machine now thinks it’s connecting to a new printer and sends a request asking for printer attributes.
- 受害者系统处理打印机属性
- CVE-2024-47076: libcupsfilters <= 2.1b1 has a vulnerability in cfGetPrinterAttributes5, which does not properly validate or sanitize the IPP attributes returned from an IPP server. When cups-browsed processes the packet, it can be tricked into reading malicious attributes sent by the attacker.
- 受害者系统连接到攻击者控制的 IPP 服务器
- CVE-2024-47175: libppd <= 2.1b1 in the ppdCreatePPDFromIPP2 function does not properly validate or sanitize IPP attributes when saving them to a temporary PPD (PostScript Printer Description) file. This allows the attacker to inject arbitrary data into a PPD file, including the FoomaticRIPCommandLine directive, which the printing system can later execute.
- Victim system initiates print job and attacker’s code is executed
CVE-2024-47177: cups-filters <= 2.0.1 is vulnerable because the foomatic-rip filter executes arbitrary commands through the FoomaticRIPCommandLine directive, allowing the attacker to run commands as the cups-browsed process. The attacker waits for the victim’s machine to initiate a print job. The moment this happens, the attacker’s malicious code will be executed (Remote Code Execution).
如何降低 RCE 风险?
对于使用 CUPS 作为业务运营一部分的公司,必须遵循Evilsocket和RedHat 建议的修复建议。这包括但不限于作为紧急优先事项应用安全补丁。
有关命令注入的一般信息,请查看我们的综合指南。
如果您有兴趣获得更多免费的编码指南,请查看Secure Code Coach,它可以帮助您掌握安全编码的最佳实践。