T08 · Insecure Dependencies
- Location
requirements.txt:1- Finding
Unpinned and inconsistent FIT parser dependency
- Content
View full analysis
=1.2,<2'" ) from e return fitparse ``` ### Technical Analysis `requirements.txt` installs the unversioned package `fit-parser`, while the code imports `fitparse` and explicitly instructs users to install `fitparse>=1.2,<2`. Package names `fit-parser` and `fitparse` are distinct normalized distribution names. This inconsistency can install an unintended package and does not guarantee that the required `fitparse` module is present. In addition, the dependency is not version-pinned and has no integrity hash, so future installation behavior can change without changes to the audited repository. Python packages may execute build or installation code during installation. Consequently, selecting an unintended, compromised, or malicious distribution could lead to code execution with the privileges of the user running `pip install -r requirements.txt`. ### Attack Path 1. A user follows the documented installation command: `pip install -r requirements.txt`. 2. The package index resolves the unversioned `fit-parser` distribution. 3. A compromised or malicious release executes package installation code. 4. The package gains the installing user's privileges and can access that user's files and environment. 5. The expected `fitparse` import may still fail, obscuring the fact that an unrelated dependency was installed. ### Impact Assessment Successful supply-chain exploitation could execute arbitrary code as the install ...[truncated 257 chars]- Remediation
View remediation
