CVE-2024-1221
Executive Summary
CVE-2024-1221 is a low-severity information disclosure vulnerability affecting PaperCut NG/MF servers running on Linux and macOS. The flaw allows an authenticated attacker (or an attacker who has obtained a valid system token through reconnaissance) to craft a malicious payload against a specific API endpoint, potentially exposing files on the server. The vulnerability has a CVSS score of 3.1, indicating low impact, but it could be leveraged in conjunction with other attacks to escalate privileges or gather sensitive data. No public exploit code or proof-of-concept is currently available, and the vendor has not released a patch.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
CVSS Breakdown & Threat Level
- CVSS Score: 3.1 (Low)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None (but requires knowledge of a system token)
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: Low
- Integrity Impact: None
- Availability Impact: None
The low CVSS score reflects the limited impact (only file exposure) and the prerequisite of obtaining a system token. However, in a targeted attack, this could be a stepping stone for further compromise.
Deep Dive & Mechanics
The vulnerability resides in an unspecified API endpoint on PaperCut NG/MF servers. The endpoint does not properly validate or sanitize user-supplied input when processing requests. An attacker who has obtained a valid system token (e.g., through social engineering, previous compromise, or token leakage) can craft a specially formed payload that tricks the server into exposing files outside the intended scope. The attack is limited to Linux and macOS systems, suggesting the issue may be related to file path handling differences in these operating systems compared to Windows.
The exact mechanism is not publicly documented, but it likely involves path traversal or improper access control on the API endpoint. The attacker must first gather a system token, which could be done through reconnaissance of exposed configuration files, logs, or by exploiting other vulnerabilities.
Vulnerable vs. Patched Code
Since no patch is available, a direct code comparison cannot be provided. However, based on the description, the vulnerable code likely lacks proper input validation or authorization checks on the API endpoint. A patched version would:
- Validate that the requesting user has the necessary permissions.
- Sanitize file paths to prevent traversal (e.g., using
realpath()or equivalent). - Require authentication for the endpoint, not just a token.
Exploitation & Lab Setup
Red Team
Prerequisites:
- A PaperCut NG/MF server running on Linux or macOS.
- A valid system token (obtained through reconnaissance or prior compromise).
Steps:
- Identify the vulnerable API endpoint (e.g.,
/api/v1/filesor similar). - Obtain a system token (e.g., from
/etc/papercut/conf/server.propertiesor via a previous exploit). - Craft a payload that includes the token and a path traversal sequence (e.g.,
../../etc/passwd). - Send the request to the endpoint.
Example payload (conceptual):
curl -X GET "https://target:9191/api/v1/files?token=SYSTEM_TOKEN&path=../../etc/passwd"
Note: No public exploit code exists; this is a hypothetical example.
Blue Team
Detection:
- Monitor API endpoint access logs for unusual path traversal patterns (e.g.,
../sequences). - Alert on requests to the vulnerable endpoint without proper authentication.
- Correlate token usage with known legitimate users.
Hunting:
- Search for requests containing
../or..\\in API parameters. - Look for repeated failed authentication attempts followed by successful token-based access.
Indicators of Compromise (IOCs)
- Network: HTTP requests to
/api/v1/filesor similar endpoints withpathparameters containing../. - File: Unauthorized access to
/etc/passwd,/etc/shadow, or other sensitive files on the server. - Log: Entries in PaperCut access logs showing
GET /api/v1/files?token=...&path=...with suspicious paths.
Detection Engineering
YARA Rule
rule CVE_2024_1221_Papercut_File_Exposure {
meta:
description = "Detects attempts to exploit CVE-2024-1221 in PaperCut NG/MF"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2024-1221"
strings:
$api_endpoint = "/api/v1/files" nocase
$path_traversal = "../" nocase
$token_param = "token=" nocase
condition:
$api_endpoint and $path_traversal and $token_param
}
Sigma Rule
title: CVE-2024-1221 PaperCut File Exposure Attempt
id: 12345678-1234-1234-1234-123456789abc
status: experimental
description: Detects HTTP requests attempting to exploit CVE-2024-1221
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'GET'
cs-uri-query|contains:
- '/api/v1/files'
- 'token='
- '../'
condition: selection
falsepositives:
- Legitimate administrative use of the API
level: medium
Suricata Rule
alert http any any -> $HOME_NET any (
msg:"CVE-2024-1221 PaperCut File Exposure Attempt";
flow:to_server,established;
content:"/api/v1/files"; http_uri;
content:"token="; http_uri;
content:"../"; http_uri;
classtype:attempted-recon;
sid:1000001;
rev:1;
)
Remediation & Mitigation
- Immediate: Restrict network access to the PaperCut API endpoint to trusted IPs only.
- Short-term: Monitor for unauthorized token usage and implement additional authentication checks.
- Long-term: Apply vendor patches when released. Consider upgrading to a version that addresses this issue.
- Workaround: Disable the vulnerable API endpoint if not required, or implement a web application firewall (WAF) rule to block path traversal patterns.
Valters IT
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.