/

CVE-2026-53940

Severity:

HIGH RISK

(8.8)

Path Traversal (CWE-22) in Conda Entry-Point Writer

CVE-2026-53940

Awaiting Analysis

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22, CWE-73

Impact:

Arbitrary File Write and Potential Code Execution

Severity:

HIGH RISK

(8.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

Conda versions before 26.5.2 could process a malicious package metadata entry point as a filesystem path without confirming that it stayed within the target environment. An attacker supplying such a package may cause files to be written outside the environment or overwrite an existing entry point, with later execution potentially running attacker-controlled Python under the installing user's privileges.

Affected context

The vulnerability occurs during installation or environment transactions involving noarch:python packages whose info/link.json metadata contains an entry-point command. Risk is present when Conda constructs the wrapper path without canonicalizing it and without verifying that the resolved destination remains inside the environment's intended bin or Scripts directory. Writes outside the prefix additionally depend on the target parent directory already existing.

Exploit preconditions

  • Attack surface: Conda package installation and environment transactions
  • Required access: Ability to cause a victim to install or process a malicious package
  • Trigger point: Creation of a Python entry-point wrapper from package metadata
  • Required package condition: The package metadata supplies a command containing path separators, traversal segments, or an absolute path
  • Why exploitation is possible: The derived path is joined to the environment prefix without enforcing a canonical path boundary
  • Additional condition: Out-of-prefix writes generally require the destination's parent directory to exist

Why this happens

The underlying flaw is an insufficiently constrained path derived from untrusted package metadata. Conda interpolated the entry-point command into a destination path and joined it with the installation prefix, but did not canonicalize the result and verify that it remained within the designated executable directory. This is primarily CWE-22, Improper Limitation of a Pathname to a Restricted Directory, and is also related to CWE-73, External Control of File Name or Path.

Potential impact

  • A malicious package may write an executable wrapper outside the intended environment directory
  • An existing in-prefix entry point could be overwritten
  • A later invocation of the overwritten entry point could execute attacker-controlled Python
  • Files owned or writable by the installing user may be modified
  • Package installation integrity and environment isolation could be weakened

General mitigation guidance

Mitigation generally focuses on treating package metadata as untrusted and

enforcing destination boundaries before any file is created.

Common defensive patterns include:

  • Canonicalizing or normalizing the candidate destination before use
  • Requiring the resolved path to remain beneath the intended bin or Scripts directory
  • Rejecting absolute paths, traversal segments, and unexpected path separators in entry-point metadata
  • Using secure path-joining helpers that enforce an allowed root
  • Preventing replacement of unrelated existing files unless an explicit, validated ownership relationship exists
  • Running package installation with least privilege and limiting writable filesystem scope
  • Applying package trust, provenance, and repository policy controls

How teams detect issues like this

Detection approaches commonly include:

  • Static analysis for path construction from package metadata without canonicalization or root containment checks
  • Code review of entry-point generation, prefix joining, and file creation logic
  • Tests using absolute paths, traversal segments, platform-specific separators, and symlinked directories
  • Runtime auditing of package transactions that create or modify files outside the environment's executable directory
  • Policy checks requiring validated package provenance and restricting installation from untrusted sources
  • Automated security review tools that flag externally controlled filenames used in filesystem operations

Sources

SourceLink
github.comgithub.com/conda/conda/commit/3987c86ccd5527177e96b48bd4dc1777dd2c9baa
github.comgithub.com/conda/conda/pull/16168
github.comgithub.com/conda/conda/releases/tag/26.5.2
github.comgithub.com/conda/conda/security/advisories/GHSA-9m8m-c4j3-rj2c

Frequently asked

questions

It is not necessarily a network-service vulnerability. Exploitation generally

requires a victim or automated process to install or process a malicious Conda

package.

The attacker needs a way to supply or distribute package content that the

target installation workflow will process. Direct access to the victim host

is not inherently required if package acquisition and installation can be

influenced.

Treat entry-point metadata as untrusted, canonicalize the destination, and

enforce that it remains beneath the intended environment executable directory

before creating or replacing a file.

Combine strict path-boundary validation with package provenance controls,

regression tests for traversal and absolute-path inputs, least-privilege

installation, and monitoring of filesystem changes during transactions.

Find out what's already
exploitable in your codebase.