CVE-2025-5321: Aim Remote Code Execution Vulnerability
LOWCVE-2025-5321 is a LOW (CVSS 6.3) remote code execution vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Aim libraries in the PyPI ecosystem. The issue involves aim vulnerable to sandbox escape leading to remote code execution. Remediation is available in the latest vendor maintenance releases.
CVE-2025-5321 at a Glance
Security Impact
CVSS: 6.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L).
How to Fix CVE-2025-5321
To remediate this vulnerability, upgrade all affected Aim dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install aim>=Latest secure release
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show aim
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2025-5321, inspect your installed packages using pip:
pip show aim
Analyze the terminal output to locate any version of Aim in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.
Note: The pip show aim command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Aim, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2025-5321 Affected Aim Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
aim
|
PyPI |
≤ 3.29.1
|
|
References
Frequently Asked Questions
What is CVE-2025-5321?
Which Aim versions are affected?
What version fixes CVE-2025-5321?
Is aim affected?
What is the CVSS score of CVE-2025-5321?
What CWE is associated with CVE-2025-5321?
How can I check PyPI dependencies for CVE-2025-5321?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-gp5h-f9c5-8355",
"modified" : "2025-06-05T00:34:03Z",
"published" : "2025-05-29T15:31:09Z",
"aliases" : [ "CVE-2025-5321" ],
"summary" : "Aim Vulnerable to Sandbox Escape Leading to Remote Code Execution",
"details" : "A vulnerability classified as critical was found in aimhubio aim up to 3.29.1. This vulnerability affects the function RestrictedPythonQuery of the file /aim/storage/query.py of the component run_view Object Handler. The manipulation of the argument Query leads to sandbox issue. The attack can be initiated remotely. The exploit has been disclosed to the public and may be used. The vendor was contacted early about this disclosure but did not respond in any way.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/E:P"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "aim"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"last_affected" : "3.29.1"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-5321"
}, {
"type" : "WEB",
"url" : "https://gist.github.com/superboy-zjc/1fc4747a0ac77a1edc8c32e1d4edc54c"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/aimhubio/aim"
}, {
"type" : "WEB",
"url" : "https://vuldb.com/?ctiid.310492"
}, {
"type" : "WEB",
"url" : "https://vuldb.com/?id.310492"
}, {
"type" : "WEB",
"url" : "https://vuldb.com/?submit.580253"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-94" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2025-06-05T00:34:03Z",
"nvd_published_at" : "2025-05-29T15:15:34Z"
}
}