CVE-2024-8238
Aimstack Aim 3.22.0
Raw vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:HSummary
CVE-2024-8238 is a high-severity Improper Neutralization of Special Elements Used in a Template Engine (CWE-1336) vulnerability in Aimstack Aim. Its CVSS base score is 8.1 (High).
Operationally, exploitation aligns with the MITRE ATT&CK technique Template Injection (T1221); ranked in the top 50% of CVEs by exploit likelihood; it is not currently listed in the CISA KEV catalog; a public proof-of-concept is referenced.
The strongest mitigations our analysis identified map to SA-11 (Developer Testing and Evaluation) and SI-10 (Information Input Validation) — see the control section below for these in your framework.
Deeper analysis AI-assisted summary
Synthesised by an AI model from the NVD description and linked references — a reading aid, not an authoritative source.
CVE-2024-8238 is a vulnerability in version 3.22.0 of aimhubio/aim, an open-source tool likely used for machine learning experiment tracking. The issue resides in the AimQL query language, which relies on an outdated version of the safer_getattr() function from RestrictedPython. This implementation fails to protect against the str.format_map() method, enabling attackers to read arbitrary attributes of Python objects and leak server-side secrets, such as those in os.environ, or potentially achieve unrestricted code execution.
Remote, unauthenticated attackers can exploit this vulnerability over the network with no user interaction required, though it demands high attack complexity. Initial exploitation allows extraction of sensitive environment variables and other secrets. If the attacker can write files to a known location on the Aim server, they can leverage str.format_map() to load a malicious .dll or .so file into the Python interpreter, resulting in full code execution. The CVSS v3.1 base score is 8.1 (AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H), mapped to CWE-1336 (Incorrect Handling of Shared Resource Lifetime).
Details on advisories, patches, or mitigations are available in the Huntr bounty report at https://huntr.com/bounties/4e140ef9-f6d1-4e68-a44c-3b9e856924d3, published on 2025-03-20.
EU & UK References
- 🇪🇺 ENISA EUVD: EUVD-2025-6893
Vulnerability Data
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…
more
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.
- CWE(s)
Related Threats
MITRE ATT&CK Enterprise Techniques
CVEs Like This One
Affected Assets
Mitigating Controls
Control response
—
—
—
V1.3.2V1.3.7V1.3.10
Mitigating Controls (NIST 800-53 r5) AI
Developer testing and static analysis can discover missing neutralization of template directives.
Input validation rejects or sanitizes untrusted data before it reaches the template engine, stopping injection of special syntax.
Security engineering principles require use of safe templating APIs and proper escaping of external input.
Mitigating Controls (NIST CSF 2.0) AI
Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→CSF cross-walk (authority under review) — links open the control.
Secure SDLC practices directly require proper input neutralization in template engines to prevent injection.
Mitigating Controls (ISO/IEC 27001:2022 Annex A) AI
Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→ISO cross-walk (authority under review) — links open the control.
Security testing can detect template-injection flaws but does not itself implement neutralization controls.
Secure development life cycle mandates input validation and sanitization that directly prevents template-injection weaknesses.
Application security requirements explicitly call for neutralizing special elements in template engines.
Secure architecture principles reduce the likelihood of unsafe template processing but do not prescribe specific neutralization techniques.
Secure coding standards require proper escaping or sandboxing of template directives, directly mitigating CWE-1336.