/

CVE-2026-24770

Severity:

CRITICAL RISK

(9.8)

Path Traversal / Zip Slip in RAGFlow MinerU ZIP Extraction

CVE-2026-24770

Analyzed

Vulnerability type

Category:

Path Traversal / Zip Slip

CWE:

CWE-22

Impact:

Arbitrary File Overwrite leading to Remote Code Execution

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

RAGFlow's MinerU parser contains a Zip Slip path traversal flaw in its ZIP extraction routine, allowing archive entries to escape the intended directory.

When a crafted ZIP file is processed from a remote MinerU server, an attacker can overwrite arbitrary files on the RAGFlow server, which may be escalated to remote code execution depending on what files are replaced.

Affected context

This vulnerability affects deployments of RAGFlow that:

  • Use version 0.23.1 (and potentially earlier versions),
  • Rely on the MinerU parser to fetch and process ZIP archives from an external mineru_server_url,
  • Allow ZIP contents to be extracted onto the server filesystem.

The issue manifests in the _extract_zip_no_root logic, where archive entry paths are not normalized or constrained to a dedicated extraction directory, enabling files to be written outside the intended path when malicious ZIP filenames are used.

Exploit preconditions

  • Attack surface: Server-side ZIP processing within the MinerU parser.
  • Required access: Ability to influence or control the ZIP archive delivered from mineru_server_url (e.g., operating a malicious MinerU server, compromising it, or controlling the content it serves).
  • Trigger point: RAGFlow invoking MinerUParser to retrieve and extract a ZIP file, which is then processed by _extract_zip_no_root.
  • Why exploitation is possible: Filenames inside the ZIP are trusted and written directly to disk without robust validation, canonicalization, or enforcement that the final paths stay within the designated extraction directory. This allows path traversal sequences (such as parent directory references) to overwrite arbitrary files on the host.

Why this happens

The core issue is a classic Zip Slip pattern, a subset of CWE-22: Path Traversal, where archive extraction code does not validate or normalize entry paths before writing them to disk.

In MinerU's _extract_zip_no_root implementation, paths provided by the ZIP entries are used directly to construct output file locations. Without stripping dangerous components (e.g., ../), rejecting absolute paths, or verifying that the resolved path remains under the intended root directory, an attacker can craft ZIP entries that escape the extraction directory. This insecure pattern arises when developers assume that archive contents are trustworthy or that the archive source is implicitly trusted, leading to file system writes outside the expected boundary.

Potential impact

  • Overwriting application configuration files that may alter behavior or disable security features.
  • Replacing executable scripts or binaries used by the application or environment, which can lead to remote code execution.
  • Planting malicious code in locations that will be executed by scheduled tasks, startup scripts, or web server runtimes.
  • Tampering with logs or data files, potentially enabling data corruption, loss of integrity, or cover-up of other malicious activity.
  • Escalating from a limited application compromise to broader system compromise, depending on file system permissions and deployment configuration.

General mitigation guidance

Effective mitigation focuses on constraining file extraction paths and reducing trust in archive contents:

  • Restrict all archive extraction to a dedicated directory and enforce that every extracted path, after normalization, remains within this directory.
  • Normalize and validate each ZIP entry path before writing, rejecting:
  • Absolute paths,
  • Paths containing parent directory segments (../),
  • Paths containing platform-specific traversal or device references.
  • Implement a strict allowlist for acceptable file types and subdirectories, discarding unknown or unexpected entries.
  • Run the RAGFlow and MinerU components under dedicated, least-privilege accounts that have limited filesystem write access, reducing impact if a traversal occurs.
  • Consider using hardened, well-reviewed archive-handling utilities or libraries that provide built-in protections against Zip Slip style issues.
  • Treat remotely supplied archives as untrusted input and subject them to the same validation, logging, and monitoring controls as other external data sources.

How teams detect issues like this

Identifying and monitoring for this vulnerability typically involves a combination of code and operational analysis:

  • Static analysis and code review:
  • Search for custom ZIP extraction logic that concatenates zip_entry.filename (or equivalent) directly into file system paths.
  • Flag uses of extractall, ad-hoc extraction loops, or manual path joins without subsequent normalization and boundary checks.
  • Verify that any path normalization is followed by an explicit check ensuring the resolved path remains within the intended base directory.
  • Secure development policies:
  • Establish guidelines requiring centralized archive handling utilities with built-in path validation.
  • Enforce security-focused code review on all file system and archive-handling changes.
  • Runtime monitoring:
  • Monitor for unexpected file writes outside designated data directories during ZIP processing operations.
  • Use file integrity monitoring (FIM) to detect unauthorized modifications to critical configuration or executable files.
  • Correlate application logs indicating ZIP extraction with system logs showing changes to sensitive paths.
  • Automated security tools (SAST/DAST) can be configured with rules to spot unsafe archive extraction patterns and suspicious file system behavior in test environments.

Sources

SourceLink
github.comgithub.com/infiniflow/ragflow/commit/64c75d558e4a17a4a48953b4c201526431d8338f
github.comgithub.com/infiniflow/ragflow/security/advisories/GHSA-v7cf-w7gj-pgf4

Frequently asked

questions

Exploitability depends on who can control the ZIP content provided to the MinerU parser. If an attacker can operate or influence the external mineru_server_url or otherwise supply archives that the parser processes, they can typically reach arbitrary file overwrite and potentially remote code execution.

Not necessarily. The critical requirement is control over the ZIP archive consumed by MinerU. In some deployments this may require authentication or compromise of a trusted upstream service; in others, misconfiguration or open endpoints may expose the attack surface without authentication.

The robust fix is to normalize and validate every archive entry path before extraction, reject paths that escape the intended directory, and enforce extraction into a dedicated, non-privileged directory. Leveraging battle-tested library routines or centralized helper functions that perform these checks consistently is recommended.

Treat all archive contents as untrusted input, apply strict path normalization and boundary checks, minimize file system permissions for application components, and mandate security-focused code review for file handling and archive extraction logic. Integrating static analysis rules that specifically target Zip Slip patterns provides an additional safety net.

Find out what's already
exploitable in your codebase.