/

CVE-2026-30345

Severity:

HIGH RISK

(7.5)

Path Traversal / Zip Slip in CTFd Admin Import Functionality

CVE-2026-30345

Deferred

Vulnerability type

Category:

Path Traversal / Zip Slip

CWE:

CWE-23

Impact:

Arbitrary File Write on Server

Severity:

HIGH RISK

(7.5)

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

A path traversal (zip slip) vulnerability in the CTFd Admin import feature allows crafted archive files to write files outside the intended import directory.

When an administrator imports a malicious archive, an attacker can potentially plant arbitrary files elsewhere on the server filesystem, enabling configuration tampering, web shell placement, or other follow-on attacks.

Affected context

This issue affects CTFd deployments where administrators use the built-in import functionality to restore or load CTF content from uploaded archives.

The vulnerability manifests when the import process extracts files from user-supplied archives without fully normalizing and constraining file paths to a designated directory.

It is most relevant in environments where admin accounts or API keys can be obtained or misused, or where unvetted archive files are imported from external sources.

Exploit preconditions

  • Attack surface: CTFd Admin import endpoint or functionality that processes uploaded archives.
  • Required access: Ability to trigger an import operation with attacker-controlled archive contents (typically admin or access to an admin's session/API).
  • Trigger point: Processing and extraction of paths inside the archive that include directory traversal sequences (for example, relative parent directory references).
  • Why exploitation is possible: The import logic trusts archive entry paths and does not correctly normalize or enforce that extracted files remain within the intended target directory, allowing traversal outside the allowed path.

Why this happens

The underlying bug belongs to the path traversal class, specifically in the context of archive extraction commonly referred to as "zip slip."

During import, file paths stored in the archive (including components such as ../) are used directly to determine extraction locations.

Without proper canonicalization, validation, and enforcement of a fixed base directory, the extraction code can be tricked into writing files outside the designated import folder, which maps to CWE-23: Relative Path Traversal.

Potential impact

  • Attacker-supplied files may be written to arbitrary locations on the server filesystem reachable by the application's write permissions.
  • Application behavior could be altered by overwriting configuration, template, or content files.
  • In some deployments, an attacker could place executable code (e.g., scripts or web shells) and potentially achieve remote code execution if the server executes those files.
  • Log files or data files may be overwritten, leading to data loss, integrity issues, or forensic evasion.

General mitigation guidance

Effective mitigation focuses on constraining where files from imports can be written and distrusting archive entry paths.

Common defensive patterns include:

  • Normalizing and canonicalizing every archive entry path, then verifying it resides within a predefined import directory before extraction.
  • Stripping or rejecting any paths that contain parent directory references, absolute paths, or unexpected path separators.
  • Using high-level archive extraction helpers or libraries that provide explicit safeguards against zip slip and enforce a safe base directory.
  • Running the application with least-privilege filesystem permissions, ensuring that even if path traversal occurs, the process cannot write to sensitive system or application directories.
  • Prefer storing imported content in isolated, non-executable directories and avoiding direct serving or execution of imported files.

How teams detect issues like this

Organizations can approach detection through:

  • Static analysis: Rules or custom checks that flag archive extraction code where entry names are concatenated directly into filesystem paths without canonicalization or boundary checks.
  • Code review: Looking for import/extraction routines that:
  • Use archive entry names directly,
  • Do not check for .., absolute paths, or path normalization,
  • Lack explicit validation that the final extraction path is under a specific base directory.
  • Runtime monitoring: Logging import operations and extracted file paths, then alerting on suspicious patterns such as ../ segments or extractions outside expected directories.
  • Security testing: Incorporating crafted zip slip test archives into CI pipelines and automated security tests to validate that extraction is constrained to the correct directory.

Sources

SourceLink
blog.ctfd.ioblog.ctfd.io/ctfd-3-8-2/
gist.github.comgist.github.com/syphonetic/2e16a6d1a44e7970c849a17efd0a2270
github.comgithub.com/CTFd/CTFd
github.comgithub.com/CTFd/CTFd/security/policy
github.comgithub.com/syphonetic/CVE-2026-30345

Frequently asked

questions

It can be, but typically only if an attacker can cause an administrator or privileged user to import a malicious archive, or if the import endpoint is exposed and insufficiently protected. The attack is generally one step removed, relying on compromised or misused admin privileges.

Usually, the attacker needs the ability to supply an archive that the CTFd Admin import feature will process—this often means admin privileges, successful social engineering of an admin, or exploitation of another issue to hijack an admin session or API token.

Enforce strict path validation when extracting archives: canonicalize each entry's path, confirm it stays within a predefined import directory, and reject any entry that attempts to traverse outside that directory or uses absolute paths.

Adopt secure file-handling patterns for all upload and import features: treat all archive contents as untrusted, rely on libraries or helper functions that prevent zip slip by design, enforce least-privilege filesystem permissions, and embed security-focused code review and automated tests for path traversal scenarios in the development process.

Find out what's already
exploitable in your codebase.