CVE-2023-39143
CVE-2023-39143
Weakness (CWE)
CVSS Vector
v3.1- Attack Vector
- Network
- Attack Complexity
- Low
- Privileges Required
- None
- User Interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- High
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).
Comprehensive Technical Analysis of CVE-2023-39143 (PaperCut NG/MF Path Traversal & RCE Vulnerability)
1. Vulnerability Assessment and Severity Evaluation
CVE ID: CVE-2023-39143 CVSS v3.1 Score: 9.8 (Critical) – AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H Vector Breakdown:
- Attack Vector (AV:N): Network-exploitable (remote attack surface).
- Attack Complexity (AC:L): Low (no special conditions required).
- Privileges Required (PR:N): None (unauthenticated exploitation).
- User Interaction (UI:N): None (fully automated exploitation possible).
- Scope (S:U): Unchanged (impact confined to vulnerable system).
- Confidentiality (C:H), Integrity (I:H), Availability (A:H): High impact across all CIA triad components.
Severity Justification
This vulnerability is critical due to:
- Unauthenticated remote exploitation (no credentials required).
- Path traversal enabling arbitrary file read/write/delete operations.
- Remote Code Execution (RCE) when external device integration is enabled (a default/common configuration).
- Low attack complexity, making it highly exploitable by threat actors with minimal technical skill.
The combination of file system manipulation and RCE makes this a high-impact, high-likelihood vulnerability, warranting immediate patching.
2. Potential Attack Vectors and Exploitation Methods
Exploitation Chain
The vulnerability stems from improper path sanitization in PaperCut NG/MF’s web interface, allowing attackers to traverse directories and manipulate files. The attack flow is as follows:
-
Initial Access:
- Attacker sends a maliciously crafted HTTP request to the PaperCut server (default port: 9191/TCP).
- No authentication is required, making this a pre-authentication vulnerability.
-
Path Traversal for Arbitrary File Operations:
- The attacker exploits insufficient input validation in file upload/download functionalities.
- By manipulating path parameters (e.g.,
../../../), the attacker can:- Read sensitive files (e.g.,
C:\Program Files\PaperCut\server\data\conf\server.properties). - Upload malicious files (e.g.,
.jsp,.war, or.exepayloads). - Delete critical files, leading to denial-of-service (DoS).
- Read sensitive files (e.g.,
-
Remote Code Execution (RCE):
- If external device integration (e.g., print spooler, scan-to-folder) is enabled, the attacker can:
- Upload a malicious script (e.g.,
.jspfor Tomcat,.warfor Java web apps). - Trigger execution by accessing the uploaded file via the web interface.
- Gain a reverse shell or execute arbitrary commands with SYSTEM privileges.
- Upload a malicious script (e.g.,
- If external device integration (e.g., print spooler, scan-to-folder) is enabled, the attacker can:
Proof-of-Concept (PoC) Exploitation
Security researchers at Horizon3.ai demonstrated a fully weaponized exploit (PoC available here) that:
- Bypasses authentication via crafted HTTP requests.
- Uploads a JSP webshell to a writable directory (e.g.,
C:\Program Files\PaperCut\server\tomcat\webapps\ROOT\). - Executes arbitrary commands via the webshell, achieving RCE.
Threat Actor Exploitation
- Opportunistic attacks: Automated scanners (e.g., Shodan, Censys) can identify exposed PaperCut instances.
- Targeted attacks: APT groups and ransomware operators (e.g., LockBit, Cl0p) may exploit this for initial access.
- Lateral movement: Once RCE is achieved, attackers can:
- Deploy ransomware.
- Exfiltrate sensitive data.
- Establish persistence (e.g., via scheduled tasks, registry modifications).
3. Affected Systems and Software Versions
Vulnerable Software
- PaperCut NG (New Generation) – All versions before 22.1.3.
- PaperCut MF (Multi-Function) – All versions before 22.1.3.
- Platform: Windows only (Linux/macOS versions are not affected).
Attack Surface
- Default Port:
9191/TCP(PaperCut web interface). - Common Deployment Scenarios:
- Enterprise print management systems.
- Educational institutions (universities, schools).
- Government and healthcare organizations.
- Exposure Risk:
- Many PaperCut instances are publicly accessible (misconfigured firewalls, lack of network segmentation).
- Shodan queries reveal thousands of exposed instances (e.g.,
port:9191 "PaperCut").
4. Recommended Mitigation Strategies
Immediate Actions (Critical Priority)
-
Apply the Patch:
- Upgrade to PaperCut NG/MF 22.1.3 or later (Vendor Advisory).
- If patching is delayed, disable external device integration (reduces RCE risk but does not fully mitigate path traversal).
-
Network-Level Protections:
- Restrict access to PaperCut’s web interface (
9191/TCP) via:- Firewall rules (allow only trusted IPs).
- Network segmentation (isolate print servers from general user networks).
- Disable unnecessary services (e.g., if external device integration is unused).
- Restrict access to PaperCut’s web interface (
-
Monitoring and Detection:
- Deploy IDS/IPS rules to detect path traversal attempts (e.g.,
../sequences in HTTP requests). - Enable PaperCut logging and monitor for:
- Unusual file uploads/downloads.
- Suspicious process execution (e.g.,
cmd.exe,powershell.exe).
- Use EDR/XDR solutions to detect post-exploitation activity (e.g., webshell execution, lateral movement).
- Deploy IDS/IPS rules to detect path traversal attempts (e.g.,
-
Temporary Workarounds (If Patching is Delayed):
- Disable the PaperCut web interface if not required (use CLI or alternative management methods).
- Implement a WAF (Web Application Firewall) with rules to block path traversal attempts.
Long-Term Hardening
-
Principle of Least Privilege (PoLP):
- Run PaperCut services with minimal permissions (avoid SYSTEM privileges where possible).
- Restrict file system permissions on PaperCut directories.
-
Regular Vulnerability Scanning:
- Use tools like Nessus, OpenVAS, or Qualys to detect unpatched PaperCut instances.
- Schedule automated patch management for critical vulnerabilities.
-
Incident Response Planning:
- Develop a playbook for PaperCut exploitation (e.g., containment, forensic analysis, recovery).
- Conduct tabletop exercises to test response to RCE incidents.
5. Impact on the Cybersecurity Landscape
Broader Implications
-
Increased Attack Surface for Enterprises:
- PaperCut is widely used in education, healthcare, and government, making this a high-value target.
- Exploitation can lead to data breaches, ransomware, and supply chain attacks.
-
Ransomware and APT Exploitation:
- Cl0p ransomware has previously targeted PaperCut vulnerabilities (e.g., CVE-2023-27350).
- State-sponsored actors may leverage this for espionage (e.g., accessing sensitive documents via print logs).
-
Supply Chain Risks:
- Compromised PaperCut servers can be used to pivot into internal networks, affecting connected systems (e.g., Active Directory, databases).
-
Regulatory and Compliance Risks:
- Organizations failing to patch may violate GDPR, HIPAA, or FISMA due to unauthorized data access.
- CISA’s Known Exploited Vulnerabilities (KEV) Catalog may include this CVE, mandating federal patching.
Historical Context
- PaperCut has been a frequent target in recent years:
- CVE-2023-27350 (RCE, CVSS 9.8) – Exploited by Cl0p ransomware.
- CVE-2023-39143 follows a similar pattern, reinforcing the need for proactive patch management.
6. Technical Details for Security Professionals
Root Cause Analysis
The vulnerability arises from insufficient path sanitization in PaperCut’s web interface, specifically in:
- File upload/download endpoints (e.g.,
/app?service=page/Upload). - External device integration handlers (e.g., scan-to-folder, print spooler interactions).
Key Technical Flaws:
-
Path Traversal via
..\Sequences:- Attackers manipulate file paths (e.g.,
..\..\..\Windows\System32\cmd.exe) to access arbitrary files. - Example exploit payload:
POST /app?service=page/Upload HTTP/1.1 Host: vulnerable-papercut:9191 Content-Type: multipart/form-data; boundary=----WebKitFormBoundary ------WebKitFormBoundary Content-Disposition: form-data; name="file"; filename="../../../../../Program Files/PaperCut/server/tomcat/webapps/ROOT/shell.jsp" Content-Type: application/octet-stream <% Runtime.getRuntime().exec(request.getParameter("cmd")); %> ------WebKitFormBoundary--
- Attackers manipulate file paths (e.g.,
-
RCE via External Device Integration:
- If scan-to-folder or print spooler integration is enabled, attackers can:
- Upload a malicious script (e.g.,
.jsp,.bat). - Trigger execution by accessing the file via the web interface or scheduled tasks.
- Upload a malicious script (e.g.,
- If scan-to-folder or print spooler integration is enabled, attackers can:
Exploitation Detection Signatures
Network-Based Indicators:
- HTTP Requests with
../sequences (e.g.,GET /..%5c..%5c..%5cWindows/win.ini). - Unusual file uploads (e.g.,
.jsp,.war,.exeextensions). - Connections to known C2 servers post-exploitation.
Host-Based Indicators:
- Unexpected child processes of
pc-app.exe(e.g.,cmd.exe,powershell.exe). - New files in
C:\Program Files\PaperCut\server\tomcat\webapps\ROOT\. - Suspicious registry modifications (e.g., persistence via
HKLM\Software\Microsoft\Windows\CurrentVersion\Run).
Forensic Analysis Considerations
-
Log Sources to Review:
- PaperCut logs (
[install_dir]\server\logs\):server.log(file operations, authentication attempts).access.log(HTTP requests).
- Windows Event Logs:
- Security Log (Event ID 4688 – Process Creation).
- Sysmon Logs (File creation, network connections).
- Web Server Logs (Tomcat/Apache if used).
- PaperCut logs (
-
Artifacts to Collect:
- Memory dumps (for webshell detection via Volatility).
- File system timeline (using
MFTECmdorAutopsy). - Registry hives (for persistence mechanisms).
-
YARA Rules for Detection:
rule PaperCut_CVE_2023_39143_Webshell { meta: description = "Detects JSP webshells related to CVE-2023-39143" reference = "https://www.horizon3.ai/cve-2023-39143-papercut-path-traversal-file-upload-rce-vulnerability/" author = "Cybersecurity Analyst" date = "2023-08-05" strings: $jsp_shell = /<%[^>]*Runtime\.getRuntime\(\)\.exec\([^)]*\)[^>]*%>/ $cmd_exec = /request\.getParameter\(["']cmd["']\)/ condition: filesize < 10KB and ($jsp_shell or $cmd_exec) }
Conclusion
CVE-2023-39143 represents a critical, easily exploitable vulnerability in PaperCut NG/MF that enables unauthenticated RCE on Windows systems. Given its high CVSS score (9.8), public PoC availability, and widespread deployment, organizations must prioritize patching and implement compensating controls to mitigate risk.
Key Takeaways for Security Teams: ✅ Patch immediately (PaperCut 22.1.3 or later). ✅ Restrict network access to PaperCut’s web interface. ✅ Monitor for exploitation attempts (path traversal, webshell uploads). ✅ Assume breach if unpatched and conduct forensic analysis.
Failure to address this vulnerability could result in data breaches, ransomware infections, or full network compromise. Proactive measures are essential to prevent exploitation by both opportunistic attackers and advanced threat groups.