T08 · Insecure Dependencies
- Location
SKILL.md:27- Finding
Unpinned Third-Party Package Installed at Runtime
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 27–32
Vulnerability Type: Unpinned runtime dependency installation
Risk Level: MediumVulnerable Code
python # Auto-install dependency to ensure zero-setup for the user try: from perplexity import AsyncPerplexity except ImportError: print("Installing perplexityai...") subprocess.check_call([sys.executable, "-m", "pip", "install", "perplexityai", "-q"]) from perplexity import AsyncPerplexityTechnical Analysis
The Skill instructs the agent to install
perplexityaifrom the default Python package index whenever the module is unavailable. The dependency has no pinned version, cryptographic hash, lockfile, or verified package source. Consequently, the code reviewed in the Skill does not fully define the code that will execute at runtime.Package installation and import can execute package-controlled code with the same permissions as the Python process. A compromised package release, compromised transitive dependency, or unexpected future update could therefore access resources available to the agent. This is especially sensitive because the runtime is expected to expose
PERPLEXITY_API_KEY.Although installing the official client supports the declared research functionality, automatic unverified installation is not the minimum-privilege implementation. The dependency should be provisioned and audited before the Skill runs.
Attack Path
- An attacker compromises a future
perplexityairelease or one of its transitive dependencies. - A user invokes the Skill in an environment where the
perplexitymodule is not installed. - The
ImportErrorhandler executespip install perplexityaiwithout a version or hash constraint. - The compromised package or dependency executes installation-time or import-time code with the agent process's permissions.
- That code accesses available resources, potentially includ ...[truncated 808 chars]
- An attacker compromises a future
- Remediation
View remediation
Remediation Suggestions
- Remove automatic package installation from the Skill execution workflow.
- Preinstall the dependency in a controlled, sandboxed runtime image.
- Pin the dependency and all transitive dependencies to reviewed versions using a lockfile.
- Require cryptographic hashes, such as pip's
--require-hashes, for every downloaded artifact. - Use an approved package repository or internal mirror with provenance and integrity controls.
- Scan and review dependency updates before deployment rather than resolving the latest release at runtime.
- Run the Skill as an unprivileged user with a read-only filesystem wherever practical.
- Restrict network egress to the package source during image construction and to the required Perplexity API endpoint during execution.
- Expose
PERPLEXITY_API_KEYonly to the search process and avoid placing unrelated credentials in the same environment.
