cups: Use After Free
CVE-2023-34241 is a high-severity use after free vulnerability in cups from OpenPrinting, with a CVSS 3.1 base score of 7.1 out of 10. It can be exploited with local access to the system by an attacker with a low-privileged account, without any action from a user. Affected cups versions: >= 2.0.0, < 2.4.6. The record does not name a fixed version, so check the vendor advisory. There is no confirmed exploitation so far. EPSS estimates a 1.38% chance of exploitation within 30 days, higher than 73% of scored CVEs.
High severity with no evidence of exploitation so far.
What to do
- Update macOS to 11.7.9 or 12.6.8 or 13.5, whichever matches your release line, or a later version.
- Read the advisory on github.com for workarounds and exact fixed builds.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| OpenPrinting | cups | >= 2.0.0, < 2.4.6 | Not stated |
| Fedora Project | Fedora | 37; 38 | Not stated |
| Debian | Debian Linux | 10.0 | Not stated |
| Apple | macOS | before 11.7.9; 12.0.0 up to, but not including, 12.6.8; 13.0 up to, but not including, 13.5 | 11.7.9, 12.6.8, 13.5 |
Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.
How the severity score breaks down
- Attack vector
- LocalThe attacker needs local access or must trick a user into running something.
- Attack complexity
- LowNo special conditions are needed; the attack works reliably.
- Privileges required
- LowA basic user account is enough.
- User interaction
- NoneNo action by a victim is required.
- Scope
- UnchangedImpact stays within the vulnerable component.
- Confidentiality
- HighAll data handled by the component can be read.
- Integrity
- NoneNothing can be modified.
- Availability
- HighThe component can be taken down completely.
Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H. Scored by NVD.
| Scoring system | Score | Severity | Scored by |
|---|---|---|---|
| CVSS 3.1 | 5.3 | Medium | CNA (github.com) |
| CVSS 3.1 | 7.1 | High | NVD |
Official description
OpenPrinting CUPS is a standards-based, open source printing system for Linux and other Unix-like operating systems. Starting in version 2.0.0 and prior to version 2.4.6, CUPS logs data of free memory to the logging service AFTER the connection has been closed, when it should have logged the data right before. This is a use-after-free bug that impacts the entire cupsd process. The exact cause of this issue is the function `httpClose(con->http)` being called in `scheduler/client.c`. The problem is that httpClose always, provided its argument is not null, frees the pointer at the end of the call, only for cupsdLogClient to pass the pointer to httpGetHostname. This issue happens in function `cupsdAcceptClient` if LogLevel is warn or higher and in two scenarios: there is a double-lookup for the IP Address (HostNameLookups Double is set in `cupsd.conf`) which fails to resolve, or if CUPS is compiled with TCP wrappers and the connection is refused by rules from `/etc/hosts.allow` and `/etc/hosts.deny`. Version 2.4.6 has a patch for this issue.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Use After Free
The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory belongs to the code that operates on the new pointer.
How developers prevent this class of flaw
- Choose a language that provides automatic memory management.
- When freeing pointers, be sure to set them to NULL once they are freed. However, the utilization of multiple or complex data structures may lower the usefulness of this strategy.
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: poc, automatable: yes, technical impact: partial).
- Record last changed materially (score, affected products, status or references).
References
Advisories
Patches and release notes
Third-party and government advisories
- openwall.com/lists/oss-security/2023/06/23/10Mailing List, Third Party Advisory
- openwall.com/lists/oss-security/2023/06/26/1Mailing List, Third Party Advisory
- lists.fedoraproject.org/archives/list/[email protected]/message/TBIYKDS3UG3W4Z7YOHTR2A…Mailing List, Third Party Advisory
- support.apple.com/kb/HT213843Third Party Advisory
- support.apple.com/kb/HT213844Third Party Advisory
- support.apple.com/kb/HT213845Third Party Advisory
Other references
Other vulnerabilities in cups
- 7.5 High severity
- 8.0 High severity
- 7.0 High severity
Recent Use After Free vulnerabilities
- 9.8 Critical severity
- 7.5 High severity
- 7.8 High severity
- 7.8 High severity
- 7.8 High severity
- 8.8 High severity
Spotted an error? Tell us.