T08 · Insecure Dependencies
- Location
analyze.py:6- Finding
Unpinned NLTK Dependency and Unverified Runtime Lexicon Download
- Content
View full analysis
Vulnerability Details
File Location:
analyze.py:6-10
Additional Location:SKILL.md:27-30
Vulnerability Type: Supply-chain risk from an unpinned dependency and runtime resource retrieval without application-level integrity verification
Risk Level: MediumVulnerable Code
analyze.py:6-10:python def ensure_vader(): try: nltk.data.find('sentiment/vader_lexicon.zip') except LookupError: # Download quietly nltk.download('vader_lexicon', quiet=True)SKILL.md:27-30:markdown - Python 3 - `nltk` library (`pip install nltk`) - `vader_lexicon` (downloaded via `nltk.downloader`)Technical Analysis
The documented installation command installs
nltkwithout a pinned version, lockfile, or package hash. Consequently, the exact code installed depends on the package version resolved when installation occurs.In addition,
ensure_vader()automatically invokes NLTK's downloader if the VADER resource is unavailable. The application does not pin a specific lexicon artifact or independently validate its checksum before use. This means the effective runtime data can depend on externally mutable package repositories, downloader metadata, and upstream resources after the skill has been reviewed.The download is documented, and the reviewed project does not itself fetch or execute arbitrary source code. This finding is therefore a supply-chain hardening issue rather than evidence of an embedded malicious payload.
Attack Path
- An attacker compromises or successfully substitutes an NLTK package release, package distribution source, downloader index, or upstream VADER resource.
- A user installs the unpinned
nltkdependency, or invokes the skill in an environment wherevader_lexiconis absent. - The environment resolves attacker-influenced package content or
ensure_vader()silently initiates retrieval throughnltk.download().
...[truncated 952 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin NLTK to a reviewed exact version in a requirements file, such as
nltk==<reviewed-version>. - Generate and enforce a lockfile containing cryptographic hashes, for example with
pip-compile --generate-hashes, and install usingpip install --require-hashes. - Retrieve the VADER lexicon during a controlled build or installation phase rather than automatically during normal execution.
- Pin the expected lexicon artifact and verify its cryptographic checksum before making it available to the application.
- Replace the implicit runtime download with a clear error explaining how to install the verified resource when it is absent.
- Use trusted package indexes over TLS, restrict alternate indexes, and periodically review dependency and artifact updates before changing pinned versions.
- Run the skill under a least-privileged account with limited filesystem and network access to reduce the effect of any future supply-chain compromise.
- Pin NLTK to a reviewed exact version in a requirements file, such as
