Arbitrary file reading vulnerability in Aim
Description
Aim is an open-source, self-hosted machine learning experiment tracking tool. Versions of Aim prior to 3.1.0 are vulnerable to a path traversal attack. By manipulating variables that reference files with “dot-dot-slash (../)” sequences and its variations or by using absolute file paths, it may be possible to access arbitrary files and directories stored on file system including application source code or configuration and critical system files. The vulnerability issue is resolved in Aim v3.1.0.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
aimPyPI | < 3.1.0 | 3.1.0 |
Affected products
1Patches
1b9e53df5e32dSecurity issue fix for `/static-files/{path}` endpoint (#1003)
1 file changed · +9 −1
aim/web/api/views.py+9 −1 modified@@ -1,15 +1,23 @@ import os +from pathlib import Path from aim.web.api.utils import APIRouter # wrapper for fastapi.APIRouter from fastapi.responses import FileResponse +from fastapi import HTTPException statics_router = APIRouter() @statics_router.get('/static-files/{path:path}/') async def serve_static_files(path): from aim import web - static_file_name = os.path.join(os.path.dirname(web.__file__), 'ui', 'build', path) + static_files_root = os.path.join(os.path.dirname(web.__file__), 'ui', 'build') + static_file_name = '/'.join((static_files_root, path)) + + # check if path is leading inside ui/build directory + if not Path(static_files_root) in Path(static_file_name).resolve().parents: + raise HTTPException(404) + compressed_file_name = '{}.gz'.format(static_file_name) if os.path.exists(compressed_file_name): return FileResponse(compressed_file_name, headers={'Content-Encoding': 'gzip'})
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
9- github.com/advisories/GHSA-8phj-f9w2-cjccghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2021-43775ghsaADVISORY
- github.com/aimhubio/aim/blob/0b99c6ca08e0ba7e7011453a2f68033e9b1d1bce/aim/web/api/views.pyghsax_refsource_MISCWEB
- github.com/aimhubio/aim/commit/b9e53df5e32d14bbd3a2c738e2db7187fb531e93ghsaWEB
- github.com/aimhubio/aim/issues/999ghsax_refsource_MISCWEB
- github.com/aimhubio/aim/pull/1003ghsax_refsource_MISCWEB
- github.com/aimhubio/aim/pull/1003/commits/f01266a1a479ef11d7d6c539e7dd89e9d5639738mitrex_refsource_MISC
- github.com/aimhubio/aim/security/advisories/GHSA-8phj-f9w2-cjccghsax_refsource_CONFIRMWEB
- github.com/pypa/advisory-database/tree/main/vulns/aim/PYSEC-2021-839.yamlghsaWEB
News mentions
0No linked articles in our index yet.