CVE-2025-55174
Executive Summary
CVE-2025-55174 is a low-severity vulnerability in KDE Skanpage, a scanning application for KDE Plasma. The flaw arises from the use of QIODevice::ReadWrite instead of QIODevice::WriteOnly when opening files for writing. This misconfiguration can lead to a partial file overwrite where the new file content is written at the beginning, followed by remnants of the old file content at the end. This could potentially leak sensitive information from previously scanned documents or cause data corruption. The vulnerability is local, requires low privileges, and has a CVSS score of 3.2. No public exploit code or proof-of-concept is available at this time.
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
Supply Chain & Package Security
This vulnerability is not related to NPM, PyPI, Go, or Ruby ecosystems. It affects the KDE Skanpage application, which is typically distributed via Linux package managers (e.g., apt, dnf, pacman) or as a Flatpak/Snap package. Users should verify their package sources and ensure they are using official KDE repositories.
CVSS Breakdown & Threat Level
- CVSS Score: 3.2 (Low)
- Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N
- Attack Vector: Local (AV:L) – The attacker must have local access to the system.
- Attack Complexity: Low (AC:L) – No special conditions are required.
- Privileges Required: Low (PR:L) – The attacker needs a standard user account.
- User Interaction: None (UI:N) – No user interaction is required.
- Scope: Unchanged (S:U) – The vulnerability does not affect other components.
- Confidentiality Impact: Low (C:L) – Partial file content leakage is possible.
- Integrity Impact: None (I:N) – No data integrity compromise.
- Availability Impact: None (A:N) – No denial of service.
Threat Level: Low. Exploitation requires local access and low privileges, and the impact is limited to potential information disclosure from file remnants.
Deep Dive & Mechanics
The vulnerability is rooted in the improper use of Qt's QIODevice flags. In KDE Skanpage, when saving scanned images or documents, the application opens a file using QIODevice::ReadWrite mode. This mode opens the file for both reading and writing without truncating the existing content. As a result, when new data is written, it overwrites the beginning of the file, but any data beyond the new content's length remains from the previous file.
For example, if a user scans a new document and saves it to a file that previously contained a larger document, the new file will contain the new scan data followed by the tail end of the old scan data. This could inadvertently leak portions of previously scanned documents.
The fix involves changing the file open mode to QIODevice::WriteOnly, which truncates the file before writing, ensuring no residual data remains.
Vulnerable vs. Patched Code
Vulnerable Code (Skanpage < 25.08.0):
QFile file(filename);
if (file.open(QIODevice::ReadWrite)) {
// Write new data
file.write(newData);
file.close();
}
Patched Code (Skanpage >= 25.08.0):
QFile file(filename);
if (file.open(QIODevice::WriteOnly)) {
// Write new data
file.write(newData);
file.close();
}
The key difference is the use of QIODevice::WriteOnly which truncates the file upon opening, preventing any old data from persisting.
Exploitation & Lab Setup
Red Team (Attack Simulation)
Prerequisites:
- Local access to a system running KDE Skanpage < 25.08.0.
- A user account with standard privileges.
Steps:
- Create a file with known content (e.g., a large scanned document).
- Use Skanpage to scan a new, smaller document and save it to the same filename.
- Open the saved file in a hex editor or text viewer. Observe that the new content is at the beginning, followed by remnants of the old content.
Example:
# Create a large dummy file
echo "This is the old large document content that should not be visible." > /tmp/scan.pdf
# Use Skanpage to scan a small document and save to /tmp/scan.pdf
# After saving, examine the file
cat /tmp/scan.pdf
# Output will show new content followed by old content remnants
Blue Team (Defense & Detection)
Detection:
- Monitor file access patterns for Skanpage processes. Look for files being opened with both read and write permissions.
- Use file integrity monitoring (FIM) to detect unexpected changes in file sizes or content.
Prevention:
- Apply the patch by upgrading to KDE Skanpage 25.08.0 or later.
- Restrict user permissions to prevent overwriting sensitive files.
- Educate users to avoid saving scans to files that previously contained sensitive data.
Indicators of Compromise (IOCs)
- File Anomalies: Files that contain a mix of new and old content, especially if the old content is from a different document.
- Process Behavior: Skanpage process opening files with
QIODevice::ReadWritemode. - System Logs: Unusual file access patterns or file size discrepancies.
Detection Engineering
YARA Rule
rule CVE_2025_55174_Skanpage_FileOverwrite {
meta:
description = "Detects KDE Skanpage file overwrite vulnerability"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-55174"
strings:
$s1 = "QIODevice::ReadWrite" ascii wide nocase
$s2 = "Skanpage" ascii wide nocase
condition:
$s1 and $s2
}
Sigma Rule
title: CVE-2025-55174 - KDE Skanpage File Overwrite
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects Skanpage opening files with ReadWrite mode
author: Valters IT
date: 2025-04-10
references:
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2025-55174
logsource:
category: process_creation
product: linux
detection:
selection:
Image|endswith: '/skanpage'
CommandLine|contains: 'QIODevice::ReadWrite'
condition: selection
falsepositives:
- Unknown
level: low
Suricata Rule
alert tcp any any -> any any (msg:"CVE-2025-55174 - KDE Skanpage File Overwrite"; flow:to_server; content:"QIODevice::ReadWrite"; nocase; classtype:attempted-user; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade KDE Skanpage to version 25.08.0 or later.
- If upgrade is not possible, manually patch the source code by changing
QIODevice::ReadWritetoQIODevice::WriteOnlyin the file save routine.
Long-term Measures:
- Implement secure file handling practices in all KDE applications.
- Conduct code reviews to ensure proper use of Qt file I/O flags.
- Use file integrity monitoring to detect unauthorized file modifications.
Workaround:
- Avoid saving scans to files that previously contained sensitive data.
- Use a dedicated directory for scanned documents and regularly clean it.
Valters IT