Back to skill

Security audit

cognitive-gate

Security checks for vulnerabilities and agentic risk

Overview

The skill is a small, coherent Python CLI/API wrapper for auditable constraint checks, with the main caution that installation pulls code from a GitHub tag rather than a fully immutable, bundled package.

Install in a least-privileged environment and prefer verifying the upstream repository or pinning an immutable commit before use, especially if running it where credentials or sensitive project files are present.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:20
Finding

Mutable Git Dependency Can Execute Unreviewed Remote Code During Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 20-24
Vulnerability Type: Supply-chain exposure through direct installation from a remote Git repository
Risk Level: Medium

Code Snippet:

markdown
## Install

```bash
python3 -m pip install "git+https://github.com/somo-ui/cognitive-gate.git@v0.1.6"
text

### Technical Analysis

The documented installation command instructs `pip` to retrieve and install code directly from an external Git repository. Although the dependency references the `v0.1.6` tag, a Git tag is not necessarily immutable and can be deleted or moved by a repository administrator or an attacker who compromises the upstream repository.

Python package installation may execute upstream-controlled build backend code or legacy installation hooks. Because the dependency's source is not included in this project, its behavior and integrity cannot be verified from the audited artifact. No evidence establishes that the current upstream package is malicious; the vulnerability is the unsafe, mutable trust relationship created by the installation method.

### Attack Path

1. An attacker compromises the upstream repository, a maintainer account, or another credential capable of modifying tags.
2. The attacker moves or recreates the `v0.1.6` tag so that it references a malicious commit.
3. The attacker places malicious behavior in package build configuration, installation hooks, or imported runtime code.
4. A user follows the installation command in `SKILL.md`.
5. `pip` downloads the attacker-controlled revision and may execute its build or installation logic.
6. The payload runs with the permissions of the account invoking `pip`.

### Impact Assessment

Successful exploitation could provide arbitrary code execution under the installing user's account. This may permit access to that user's files, environment variables, credentials, network resources, and any other resources available to
...[truncated 318 chars]
Remediation
View remediation

Remediation Suggestions

  • Pin the dependency to a reviewed, immutable Git commit SHA rather than a mutable tag.
  • Prefer a vetted package distributed through a trusted registry with provenance attestations and reproducible release procedures.
  • Where archive or wheel installation is used, require cryptographic hashes and enforce them with pip --require-hashes.
  • Verify release signatures or repository provenance before installation.
  • Review and lock all transitive dependencies rather than relying only on the top-level version.
  • Build and install dependencies in an isolated, least-privileged environment without access to production credentials or sensitive host resources.
  • Vendor the reviewed source into the project when practical so that the effective installed code is included in future audits.
  • Document the exact reviewed commit and establish an update process requiring security review before changing it.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep