CVE-2025-64343
Executive Summary
CVE-2025-64343 is a local privilege escalation vulnerability in the Anaconda Constructor tool (versions 3.12.2 and below). The vulnerability arises because the installer does not explicitly set permissions on the installation directory, causing it to inherit the often permissive permissions of its parent directory. In shared or non-restricted directories, this can allow any authenticated local user to write to the installation directory during or after installation. This can lead to arbitrary code execution, privilege escalation, or persistent compromise of the Conda environment.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability affects the Conda package ecosystem. Anaconda Constructor is a tool used to create custom Conda installers. If a malicious or compromised installer is created using a vulnerable version of Constructor, the resulting installer will also be vulnerable. This can propagate the insecure permission issue downstream to end users, potentially affecting many Conda-based distributions and environments.
CVSS Breakdown & Threat Level
- CVSS Score: 7.8 (High)
- Attack Vector: Local (AV:L)
- Attack Complexity: Low (AC:L)
- Privileges Required: Low (PR:L)
- User Interaction: None (UI:N)
- Scope: Unchanged (S:U)
- Confidentiality Impact: High (C:H)
- Integrity Impact: High (I:H)
- Availability Impact: High (A:H)
Threat Level: High. While the attack vector is local, the low complexity and low privileges required make it a significant threat in multi-user environments or shared systems.
Deep Dive & Mechanics
The vulnerability is rooted in how the Conda Constructor creates the installation directory. When a user runs the installer, it creates a directory (e.g., /opt/anaconda3 or ~/anaconda3) without explicitly setting permissions. On Unix-like systems, the mkdir system call creates a directory with permissions inherited from the parent directory's default ACL or umask. In many shared or non-restricted directories (e.g., /opt, /usr/local, or even /tmp), the default permissions are often 0777 (world-writable) or 0755 (world-readable and group-writable). This means the newly created installation directory may be writable by any authenticated user on the system.
An attacker with local access can:
- Identify a vulnerable Conda installation directory.
- Write malicious files (e.g., modified Python scripts, shared libraries, or configuration files) into the installation directory.
- When a legitimate user runs a Conda command or activates the environment, the malicious code executes with the victim's privileges.
The vulnerability persists after installation because the permissions are not corrected post-installation. The fix in version 3.13.0 explicitly sets the installation directory permissions to 0755 (owner-writable, world-readable/executable) and ensures that the directory is not world-writable.
Vulnerable vs. Patched Code
Vulnerable Code (Constructor <= 3.12.2):
# Simplified example of vulnerable behavior
import os
import tempfile
def create_install_dir(path):
# No explicit permission setting
os.makedirs(path, exist_ok=True)
# Permissions are inherited from parent directory
Patched Code (Constructor >= 3.13.0):
# Simplified example of patched behavior
import os
import stat
def create_install_dir(path):
# Create directory with secure permissions
os.makedirs(path, exist_ok=True)
# Explicitly set permissions to 0755
os.chmod(path, stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH)
The key difference is the explicit os.chmod() call that sets the directory permissions to 0755, preventing world-writable access.
Exploitation & Lab Setup
Red Team
Prerequisites:
- Local access to a system with a vulnerable Conda installation (e.g., in
/opt/anaconda3). - The installation directory must be world-writable (e.g., permissions 0777 or 0755 with group write).
Exploitation Steps:
- Identify the vulnerable installation directory:
ls -la /opt/anaconda3 - If the directory is world-writable (e.g.,
drwxrwxrwx), proceed. - Create a malicious Python script that will be executed when Conda is used:
echo 'import os; os.system("id > /tmp/pwned.txt")' > /opt/anaconda3/lib/python3.9/site-packages/malicious.py - Modify a Conda configuration file to load the malicious script:
echo 'import sys; sys.path.insert(0, "/opt/anaconda3/lib/python3.9/site-packages"); import malicious' >> /opt/anaconda3/lib/python3.9/site-packages/sitecustomize.py - When any user runs
condaor activates the environment, the malicious code executes.
Alternative Attack Vector:
- Replace a legitimate shared library (e.g.,
libcrypto.so) with a malicious one usingLD_PRELOADor direct file overwrite.
Blue Team
Detection:
- Monitor for unexpected file writes to Conda installation directories.
- Check for world-writable permissions on Conda directories:
find /opt/anaconda3 -type d -perm /o+w -exec ls -la {} \; - Verify that the installation directory has permissions 0755 or stricter.
Prevention:
- Ensure that Conda installations are placed in directories with restrictive permissions (e.g.,
/opt/anaconda3with 0755). - Use the latest version of Constructor (>= 3.13.0) when creating installers.
- Apply the principle of least privilege: do not allow regular users to write to system-wide Conda installations.
Hunting:
- Look for processes spawned from Conda directories that exhibit unusual behavior (e.g., network connections, file modifications).
- Audit Conda configuration files for unauthorized modifications.
Indicators of Compromise (IOCs)
File System:
- World-writable Conda installation directories (e.g.,
/opt/anaconda3with permissions 0777 or 0755 with group write). - Unexpected files in Conda
site-packagesorlibdirectories. - Modified
sitecustomize.pyorusercustomize.pyfiles. - Presence of
malicious.pyor similar files in Conda paths.
- World-writable Conda installation directories (e.g.,
Process:
- Unusual child processes spawned from
condaor Python interpreters located in Conda directories. - Processes attempting to write to Conda directories from non-privileged users.
- Unusual child processes spawned from
Network:
- Outbound connections from Conda processes to unexpected IPs or domains (if the malicious payload includes a reverse shell).
Detection Engineering
YARA Rule
rule CVE_2025_64343_Conda_Permissions {
meta:
description = "Detects world-writable Conda installation directories"
author = "Valters IT"
date = "2025-04-10"
cve = "CVE-2025-64343"
strings:
$conda_path = /\/opt\/anaconda[0-9]*\/|~\/anaconda[0-9]*\//
condition:
$conda_path and (uint32(0) & 0x0002) // Check for world-writable bit
}
Sigma Rule
title: World-Writable Conda Installation Directory
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects creation or modification of world-writable directories under Conda installation paths
author: Valters IT
date: 2025-04-10
tags:
- cve.2025.64343
- attack.t1574
logsource:
category: file_event
product: linux
detection:
selection:
TargetFilename|startswith:
- '/opt/anaconda'
- '/home/*/anaconda'
TargetFilename|endswith: '/'
condition: selection
falsepositives:
- Legitimate Conda installations in shared directories with proper ACLs
level: high
Suricata Rule
alert tcp $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-64343 - Potential Conda Backdoor Communication"; flow:to_server,established; content:"|2f|opt|2f|anaconda"; nocase; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade Anaconda Constructor to version 3.13.0 or later.
- For existing installations, manually fix permissions:
sudo chmod -R 755 /opt/anaconda3 sudo chown -R root:root /opt/anaconda3 - Rebuild any custom installers using the patched version of Constructor.
Long-Term Mitigations:
- Implement file integrity monitoring (FIM) for Conda directories.
- Use SELinux or AppArmor to restrict write access to Conda paths.
- Educate users to avoid installing Conda in world-writable directories.
- Regularly audit permissions on all Conda installations.
Detection:
- Deploy the provided YARA, Sigma, and Suricata rules.
- Monitor for anomalous file writes to Conda directories.
Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert