Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2024-29189 Overview
CVE-2024-29189 is an OS command injection vulnerability [CWE-78] in PyAnsys Geometry, a Python client library for the Ansys Geometry service and other CAD Ansys products. The flaw resides in the _start_program method within src/ansys/geometry/core/connection/product_instance.py. When invoked directly, the method allows an attacker with local access to execute arbitrary commands on the host running the script. The maintainers released fixes in versions 0.3.3 and 0.4.12.
Critical Impact
Local attackers with low privileges can execute arbitrary operating system commands on machines running vulnerable PyAnsys Geometry scripts, leading to full compromise of confidentiality, integrity, and availability.
Affected Products
- Ansys PyAnsys Geometry versions prior to 0.3.3 (0.3.x branch)
- Ansys PyAnsys Geometry versions prior to 0.4.12 (0.4.x branch)
- Python environments invoking the _start_program method in product_instance.py
Discovery Timeline
- 2024-03-26 - CVE-2024-29189 published to NVD
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2024-29189
Vulnerability Analysis
The vulnerability is an OS command injection flaw in the PyAnsys Geometry connection module. The _start_program function in product_instance.py invokes Python's subprocess module to launch the Ansys backend. Because the method accepts caller-controlled input and passes it to subprocess without strict sanitization, direct invocation can be abused to execute arbitrary commands under the current user's privileges. The vulnerability is local in nature and requires the attacker to interact with a Python process that imports and calls the affected method.
Root Cause
The root cause is improper neutralization of special elements used in an OS command [CWE-78]. The method was designed to spawn the Ansys backend process, but the input validation and process invocation patterns were insufficient when _start_program was called directly rather than through the intended higher-level API. Static analysis tooling such as Bandit flags this subprocess usage pattern (rule B602) due to the risk of shell interpretation of attacker-influenced arguments.
Attack Vector
Exploitation requires local access and low privileges, with no user interaction. An attacker who can influence the arguments passed to _start_program, for example through a malicious script, notebook, or configuration file that a developer executes, can trigger command execution in the user's security context. On compromised multi-user systems or developer workstations, this results in high impact to confidentiality, integrity, and availability.
# Security patch: src/ansys/geometry/core/connection/product_instance.py
import os
import signal
import socket
-import subprocess
+
+# Subprocess is needed to start the backend. But
+# the input is controlled by the library. Excluding bandit check.
+import subprocess # nosec B404
from ansys.tools.path import get_available_ansys_installations, get_latest_ansys_installation
from beartype.typing import TYPE_CHECKING, Dict, List
Source: GitHub commit 9020717
# Platform restriction patch for prepare_and_start_backend
"""
from ansys.geometry.core.modeler import Modeler
+ if os.name != "nt": # pragma: no cover
+ raise RuntimeError("Method 'prepare_and_start_backend' is only available on Windows.")
+
port = _check_port_or_get_one(port)
installations = get_available_ansys_installations()
if product_version != None:
Source: GitHub commit f82346b
The second patch restricts prepare_and_start_backend to Windows hosts, narrowing the attack surface for the subprocess invocation path.
Stop Remote Code Execution Before It Runs
Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.
Stop Exploit AttemptsDetection Methods for CVE-2024-29189
Indicators of Compromise
- Unexpected child processes spawned by Python interpreters running PyAnsys Geometry scripts.
- Shell processes (cmd.exe, powershell.exe, /bin/sh) launched from python.exe with unusual command lines.
- Modifications to Ansys configuration files or Python scripts that call _start_program with suspicious arguments.
Detection Strategies
- Audit Python environments for installed versions of ansys-geometry-core below 0.3.3 or between 0.4.0 and 0.4.11.
- Use static analysis tools such as Bandit to flag subprocess usage with shell=True or caller-controlled arguments.
- Monitor process creation telemetry for Python processes spawning command interpreters outside of normal engineering workflows.
Monitoring Recommendations
- Enable detailed process creation logging on developer workstations and engineering build servers that run Ansys tooling.
- Alert on command-line patterns referencing product_instance.py combined with shell metacharacters.
- Correlate PyAnsys Geometry process events with file system changes in user profile directories to identify post-exploitation activity.
How to Mitigate CVE-2024-29189
Immediate Actions Required
- Upgrade PyAnsys Geometry to version 0.3.3 or 0.4.12 or later immediately in all developer and production environments.
- Inventory Python projects and virtual environments for vulnerable ansys-geometry-core installations and remediate.
- Restrict execution of untrusted PyAnsys Geometry scripts and Jupyter notebooks on engineering workstations.
Patch Information
The PyAnsys Geometry maintainers addressed the vulnerability in versions 0.3.3 and 0.4.12. The fixes are tracked in GitHub Pull Request #1076 and GitHub Pull Request #1077. Full technical details are available in the GitHub Security Advisory GHSA-38jr-29fh-w9vm.
Workarounds
- Avoid calling the internal _start_program method directly; use only the documented public API such as prepare_and_start_backend.
- Run PyAnsys Geometry workloads under least-privilege user accounts to limit the impact of command execution.
- Apply application allow-listing to prevent Python interpreters from spawning unauthorized shell processes.
# Upgrade to patched versions of PyAnsys Geometry
pip install --upgrade "ansys-geometry-core>=0.4.12"
# For the 0.3.x branch
pip install --upgrade "ansys-geometry-core>=0.3.3,<0.4.0"
# Verify installed version
pip show ansys-geometry-core | grep -i version
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

