Gammapy versions through 2.1 have a code injection vulnerability in the WcsGeom.from_header() function. This vulnerability arises because the function passes the WCSSHAPE FITS header card to Python's eval(), allowing an attacker to supply a crafted .fits file containing a malicious Python expression. When such a file is loaded via Map.read(), the attacker's code executes with the privileges of the user running the process.