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

- Severity: Medium 5.9 (CVSS:3.0, scored by @huntr_ai) `CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.94%, higher than 60% of CVEs (2026-11-30)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2025-03-20T10:11:09.622Z
- Modified: 2026-07-07T17:57:06.075Z
- Also known as: GHSA-r229-5wgf-f28g, PYSEC-2026-1094
- Weaknesses: CWE-284, CWE-1336
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: @huntr_ai

## 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.

(As written by CVE List.)

## Affected

- aimhubio aimhubio/aim: from unspecified up to latest
- aim (PyPI): from 3.0.0 up to 3.22.0
- aimstack aim: 3.22.0

## Every score

- @huntr_ai: CVSS:3.0 5.9 Medium `CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N`
- GitHub: CVSS:3.0 5.9 Medium `CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N`
- NVD: CVSS:3.1 8.1 High `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H`
- PyPA Advisory Database: CVSS:3.0 5.9 Medium `CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N`

## References

- <https://huntr.com/bounties/4e140ef9-f6d1-4e68-a44c-3b9e856924d3> (exploit, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-8238> (advisory)
- <https://github.com/aimhubio/aim> (package)
- <https://github.com/aimhubio/aim/blob/main/aim/storage/query.py#L45> (web)
- <https://pypi.org/project/aim> (package)
- <https://github.com/advisories/GHSA-r229-5wgf-f28g> (advisory)

## Sources

- CVE List: [CVE-2024-8238](https://www.cve.org/CVERecord?id=CVE-2024-8238), CVE Terms of Use, modified 2025-10-15
- GitHub Advisory Database: [GHSA-r229-5wgf-f28g](https://github.com/advisories/GHSA-r229-5wgf-f28g), CC-BY-4.0, modified 2026-07-07
- NVD: [CVE-2024-8238](https://nvd.nist.gov/vuln/detail/CVE-2024-8238), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2026-1094](https://osv.dev/vulnerability/PYSEC-2026-1094), CC-BY-4.0, modified 2026-07-07

---

Page: https://cve.day/CVE-2024-8238 · Whole record: https://cve.day/CVE-2024-8238.json · Rebuilt by cve.day 2026-11-25T22:58:52.393Z
