/

CVE-2026-35464

Severity:

HIGH RISK

(7.5)

Unsafe Deserialization in pyLoad Download Directory

CVE-2026-35464

Analyzed

Vulnerability type

Category:

Unsafe Deserialization

CWE:

CWE-502, CWE-863

Impact:

Remote Code Execution

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

pyLoad allows certain non-admin users to change the storage_folder configuration in a way that can redirect downloads into Flask's filesystem session store.

By planting a malicious pickle payload as a crafted session file and then triggering a request with the matching session cookie, an attacker can cause arbitrary code execution on the server.

Affected context

The vulnerability affects pyLoad deployments where:

  • Flask's filesystem-based session store is in use and accessible on the server filesystem
  • Non-admin users can obtain SETTINGS and ADD permissions
  • The storage_folder configuration is not treated as a strictly admin-only option

In these conditions, download paths can be redirected so that attacker-controlled files land inside the directory used for Flask session storage, where they may later be deserialized.

Exploit preconditions

  • Attack surface: HTTP interface of pyLoad, including authenticated configuration endpoints and typical web requests that create or load sessions.
  • Required access: An authenticated user account with SETTINGS and ADD permissions (but not necessarily full admin privileges).
  • Trigger point: Flask's session loading mechanism, which deserializes session data (e.g., via pickle) from files mapped to session cookies.
  • Why exploitation is possible: The storage_folder option is not enforced as admin-only and is insufficiently constrained, allowing a non-admin user to:
  1. Redirect downloads into the Flask session directory.
  2. Create a file with attacker-controlled pickle content that matches a predictable session filename.
  3. Induce Flask to load and deserialize that file when a request presents the corresponding session cookie.

Why this happens

The core issue combines unsafe deserialization (CWE-502) with missing or incorrect authorization (CWE-863).

On one side, the web framework's session subsystem relies on deserialization of session files (e.g., pickled Python objects), which is inherently dangerous when the backing storage can be influenced by an attacker. On the other side, the application's configuration model allows a non-admin user, granted certain capabilities (SETTINGS and ADD), to change a sensitive path (storage_folder) that determines where downloaded content is written.

This design creates a path-traversal-like control over a security-critical directory: the session store. Because session files are named and loaded in a predictable manner, an attacker can cause arbitrary, attacker-crafted serialized objects to be deserialized in a privileged context, leading directly to code execution. Conceptually, this reflects a pattern where user-controllable configuration influences the trust boundary of a deserialization sink that assumes only trusted data resides in its storage location.

Potential impact

  • Execution of arbitrary Python code on the server hosting pyLoad
  • Full compromise of the pyLoad process and its data, including download lists and stored credentials
  • Use of the compromised server as a pivot point for further attacks within the hosting environment
  • Modification or deletion of downloaded files and tampering with future downloads
  • Unauthorized access to secrets, tokens, or configuration files accessible to the pyLoad process

General mitigation guidance

Effective mitigation focuses on tightening authorization around configuration and removing unsafe deserialization from the trust boundary:

  • Treat any configuration option that influences security-sensitive paths (session directories, config directories, executable or script locations) as admin-only, regardless of historical defaults.
  • Enforce strict validation on path-like settings:
  • Restrict them to known-safe base directories within the application's data root.
  • Disallow paths that resolve to framework internals or system directories (such as session stores or temporary execution paths).
  • Avoid using general-purpose serialization mechanisms (e.g., Python pickle) for session or configuration data, especially where file-backed storage may be influenced indirectly by user actions.
  • Apply least-privilege principles to the application runtime:
  • Run pyLoad under a dedicated, minimal-privilege account.
  • Limit writable directories for that account to only those needed for normal operation.
  • Establish secure defaults: ensure that out-of-the-box configuration isolates user-controlled data from framework internals, especially session and cache directories.

How teams detect issues like this

Detection typically combines configuration review with code-level analysis:

  • Static analysis / code review:
  • Look for configuration options that control filesystem paths and are exposed to non-admin or partially privileged users.
  • Identify usage of unsafe serialization/deserialization APIs (e.g., pickle) in session or configuration handling code.
  • Verify that session storage locations cannot be influenced by user-controlled settings.
  • Configuration audits:
  • Periodically scan deployed instances to ensure that storage_folder and similar options do not point to framework internals or shared system directories.
  • Check permission models to confirm that only admins can modify security-critical configuration keys.
  • Runtime monitoring:
  • Monitor for unusual file creation patterns within session directories (e.g., non-session-like file contents or rapid creation of large or binary files).
  • Aggregate and alert on unexpected deserialization-related exceptions or errors that may indicate probing attempts.
  • Automated security scanning tools can be configured with rules targeting unsafe deserialization sinks and privilege gaps in configuration endpoints to catch similar patterns across the codebase.

Sources

SourceLink
github.comgithub.com/pyload/pyload/commit/c4cf995a2803bdbe388addfc2b0f323277efc0e1
github.comgithub.com/pyload/pyload/security/advisories/GHSA-4744-96p5-mp2j
github.comgithub.com/pyload/pyload/security/advisories/GHSA-r7mc-x6x7-cqxx
cve.orgcve.org/CVERecord?id=CVE-2026-33509

Frequently asked

questions

Yes. An attacker who can authenticate to pyLoad with sufficient permissions (SETTINGS and ADD) can exploit the vulnerability purely over HTTP, without local filesystem access.

The attacker needs an account with SETTINGS and ADD permissions but does not need full administrative rights. Anonymous users without these permissions cannot directly exploit this specific configuration-based issue.

The safest pattern is to lock down security-sensitive configuration options to administrators only, and to ensure that user-controlled settings can never direct data into directories used by deserialization-based mechanisms like session stores. Where possible, replace unsafe serialization formats with safer, non-executable data formats (e.g., JSON with strict schema validation).

Adopt a design principle that no untrusted or user-influenced data should ever reach deserialization sinks capable of executing code. Combine this with a clear privilege model for configuration settings, comprehensive path validation for filesystem-related options, and regular security reviews of any component that deserializes data or loads files based on user-controlled configuration.

Find out what's already
exploitable in your codebase.