Skip to content

Arbitrary file reading vulnerability

High
gorarakelyan published GHSA-8phj-f9w2-cjcc Nov 23, 2021

Package

pip aim (pip)

Affected versions

<=3.0.6

Patched versions

3.1.0

Description

Impact

A path traversal attack aims to access files and directories that are stored outside the web root folder. 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.

Vulnerable code:

@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)
compressed_file_name = '{}.gz'.format(static_file_name)
if os.path.exists(compressed_file_name):
return FileResponse(compressed_file_name, headers={'Content-Encoding': 'gzip'})
return FileResponse(static_file_name)

Patches

The vulnerability issue is resolved in Aim v3.1.0.

References

https://owasp.org/www-community/attacks/Path_Traversal

Severity

High
7.1
/ 10

CVSS base metrics

Attack vector
Adjacent
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
Low
Availability
None
CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N

CVE ID

CVE-2021-43775

Weaknesses

Credits