A critical remote code execution vulnerability (CVE-2024-5751) affects litellm versions prior to 1.40.16. The flaw exists in the add_deployment function, which unsafely uses eval by decoding and decrypting environment variables and assigning them to os.environ. An attacker can exploit this by sending a crafted payload to the /config/update endpoint, leading to arbitrary code execution when the get_secret function is called. This vulnerability requires the server to be configured with Google KMS and a database for model storage. The issue is fixed in version 1.40.16.