Your Metadata Scrubber May Be Leaking Files
TL;DR: The metadata removal tool mat2 has a security flaw on Ubuntu systems. A specially crafted ZIP file can trick the tool into exposing sensitive information, turning a privacy feature into a potential data leak.
Key facts
- Category
- Cybersecurity
- Impact
- Medium
- Published
- Source
- Ubuntu Security Notices
Full summary
A security flaw in the mat2 metadata scrubber can be exploited by crafted ZIP files to leak sensitive user information.
A tool designed to enhance privacy by stripping sensitive metadata from files has been found to do the opposite under certain conditions. According to a recent Ubuntu Security Notice, the `mat2` metadata removal tool contains a significant vulnerability. The tool is widely used by developers, journalists, and security-conscious individuals to clean files like images, documents, and audio recordings of hidden data such as GPS coordinates, device information, and author names before sharing them. The discovered flaw means that when `mat2` is used to clean a specially crafted ZIP archive, it can be tricked into accessing and potentially exposing sensitive files from the user's own computer, creating an information disclosure risk.
The vulnerability stems from a classic security mistake known as a path traversal error. When `mat2` processes a ZIP file, it is supposed to unpack, clean, and repack the contents within a secure, temporary location. However, the tool failed to properly validate the file paths listed inside the archive. An attacker can create a ZIP file containing a malicious path, such as `../../../../etc/passwd`, which points to files outside of the intended working directory. When the vulnerable version of `mat2` attempts to process this entry, instead of handling a file within the archive, it follows the path and accesses a sensitive system file on the host machine. This effectively turns the tool against itself, using its file-reading capabilities to exfiltrate data it was never meant to see.
This incident is a powerful illustration of the risks associated with processing untrusted inputs, a fundamental challenge in software security. It highlights the irony that even tools built specifically for security and privacy are not immune to vulnerabilities. The flaw is particularly dangerous in automated systems, such as a web service that automatically cleans user-uploaded files or an email gateway that scrubs attachments. In these scenarios, an attacker could simply submit a malicious file and exploit the vulnerability without any direct user interaction. This pattern is not new; path traversal flaws have plagued software for decades, from web servers to file-sharing applications, serving as a constant reminder that all external data must be treated as potentially hostile and rigorously sanitized before being processed.
For teams using `mat2`, the immediate step is to apply the patch provided by Ubuntu. The broader lesson for developers and IT teams is to reinforce security best practices for any software that handles external files. This includes running such tools in sandboxed environments with minimal file system privileges, which can limit the potential damage if a vulnerability is exploited. It is also a reminder to conduct regular security audits of all software dependencies, no matter how small or seemingly benign. As attackers continue to probe for weaknesses in every part of the software supply chain, the security of utility tools like `mat2` becomes just as critical as that of a primary application. Organizations should remain vigilant for similar vulnerabilities in other file processing libraries, as complex formats like ZIP archives are often a source of security issues.
Why it matters
This vulnerability undermines the core purpose of a metadata removal tool, turning a trusted security utility into a potential vector for information disclosure. For developers and security teams using mat2 in automated pipelines, it creates a risk of unintentionally exposing sensitive files from their own systems.
Business impact
A flaw in a common open-source privacy tool creates a tangible data leak risk. If automated systems process untrusted files with the vulnerable mat2 version, the company could face accidental exposure of confidential data, leading to compliance violations or loss of intellectual property.
⚡ Action needed
Update the `mat2` package on affected Ubuntu systems to the latest version to patch the vulnerability.
Action checklist
- 1Identify all systems running the `mat2` tool, especially within automated workflows.
- 2Use your package manager (e.g., `apt`) to update the `mat2` package to the patched version.
- 3Verify the update was successful by checking the installed package version.
- 4Review logs for any past processing of suspicious ZIP archives if possible.
Tags
Related on Notifire
Related stories
Primary source: Ubuntu Security Notices
