CVE-2021-43775: Aim Arbitrary File Reading Vulnerability Vulnerability

CRITICAL
Advisory Identifier: GHSA-8phj-f9w2-cjcc
CVSS 8.6
CWE-22
Published
Advisory Summary

CVE-2021-43775 is a CRITICAL (CVSS 8.6) arbitrary file reading vulnerability vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Aim libraries in the PyPI ecosystem. The issue involves arbitrary file reading vulnerability in aim. Remediation is available by upgrading affected packages to version 3.1.0.

CVE-2021-43775 at a Glance

CVE Identifier CVE-2021-43775
GHSA Identifier GHSA-8phj-f9w2-cjcc
Severity CRITICAL
CVSS v3.1 Base Score 8.6
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Aim
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 8.6

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2021-43775

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.

aim fixed: 3.1.0
pip install aim>=3.1.0
Verify Direct and Transitive Dependencies

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-2021-43775, 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 3.1.0), 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-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. 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

### 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: https://github.com/aimhubio/aim/blob/0b99c6ca08e0ba7e7011453a2f68033e9b1d1bce/aim/web/api/views.py#L9-L16 ### Patches The vulnerability issue is resolved in Aim v3.1.0. ### References https://owasp.org/www-community/attacks/Path_Traversal

CVE-2021-43775 Affected Aim Versions

1 component(s)
Fixed Versions:
3.1.0
Product / Package Ecosystem Affected Versions Fixed Version
aim
PyPI
< 3.1.0
3.1.0

References

Frequently Asked Questions

What is CVE-2021-43775?
CVE-2021-43775 is a security vulnerability in Aim involving Arbitrary file reading vulnerability in Aim under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Which Aim versions are affected?
Affected versions include releases prior to 3.1.0 across affected packages: aim.
What version fixes CVE-2021-43775?
Upgrading to 3.1.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is aim affected?
Yes, aim is affected in releases prior to 3.1.0. Upgrade your dependency to 3.1.0 or later.
What is the CVSS score of CVE-2021-43775?
CVE-2021-43775 has a CVSS v3.1 base score of 8.6 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N.
What CWE is associated with CVE-2021-43775?
CVE-2021-43775 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check PyPI dependencies for CVE-2021-43775?
Run the dependency tree command: 'pip show aim'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-8phj-f9w2-cjcc",
  "modified" : "2024-11-18T16:26:17Z",
  "published" : "2021-11-23T22:03:23Z",
  "aliases" : [ "CVE-2021-43775" ],
  "summary" : "Arbitrary file reading vulnerability in Aim",
  "details" : "### Impact\nA 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.\n\nVulnerable code: https://github.com/aimhubio/aim/blob/0b99c6ca08e0ba7e7011453a2f68033e9b1d1bce/aim/web/api/views.py#L9-L16\n\n### Patches\nThe vulnerability issue is resolved in Aim v3.1.0.\n\n### References\nhttps://owasp.org/www-community/attacks/Path_Traversal\n\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:H/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "aim"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.1.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/aimhubio/aim/security/advisories/GHSA-8phj-f9w2-cjcc"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-43775"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/aimhubio/aim/issues/999"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/aimhubio/aim/pull/1003"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/aimhubio/aim/commit/b9e53df5e32d14bbd3a2c738e2db7187fb531e93"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/aimhubio/aim"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/aimhubio/aim/blob/0b99c6ca08e0ba7e7011453a2f68033e9b1d1bce/aim/web/api/views.py#L9-L16"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/aim/PYSEC-2021-839.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-11-23T18:48:09Z",
    "nvd_published_at" : "2021-11-23T21:15:00Z"
  }
}