Back to skill

Security audit

Cognitive Loop

Security checks for vulnerabilities and agentic risk

Overview

The skill is a disclosed high-autonomy planning loop with scoped memory use, but users should review the external unpinned package before installing it.

Install only after reviewing the cognitive-agent source/package, prefer a pinned version or reviewed commit, run first use in a sandbox, and keep persistent memory limited to the documented memory directory.

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:52
Finding

Unpinned Third-Party Package and Source Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 52 and 64-66
Vulnerability Type: Unpinned and mutable third-party executable dependency
Risk Level: Medium

Vulnerable Code

bash
npm install cognitive-agent
bash
git clone https://github.com/World-peace001/cognitive-agent.git
cd cognitive-agent
npm install

Technical Analysis

The documented installation procedures do not pin the cognitive-agent npm package to a reviewed version, package integrity digest, or immutable source commit. The source-based procedure clones the repository's mutable default branch and then resolves dependencies without requiring a committed lockfile.

Consequently, the code installed by a user can differ from the code reviewed when this Skill was published. npm installation can also execute package lifecycle scripts, including scripts supplied by the direct package or relevant dependencies. If the npm package, source repository, maintainer account, release process, or dependency chain is compromised, the installation procedure could execute attacker-controlled code.

The external implementation is not included in the audited project, so its behavior and transitive dependency graph could not be verified through this audit.

Attack Path

  1. An attacker compromises the upstream npm package, source repository, maintainer credentials, or a dependency resolved during installation.
  2. The attacker publishes a modified package, changes the repository's default branch, or introduces a malicious dependency or lifecycle script.
  3. A user follows the instructions and runs npm install cognitive-agent or clones the mutable default branch and runs npm install.
  4. npm retrieves the modified content and may execute its lifecycle scripts during installation.
  5. Attacker-controlled code runs with the permissions of the account performing the installation.

Impact Assessment

Successful exploitation coul ...[truncated 553 chars]

Remediation
View remediation

Remediation Suggestions

  1. Pin cognitive-agent to a specifically reviewed version rather than installing the latest available release.
  2. Record and verify the expected npm package integrity digest.
  3. For source installations, check out an immutable, reviewed Git commit rather than the repository's default branch.
  4. Commit a reviewed lockfile and use npm ci to enforce deterministic dependency resolution.
  5. Perform the initial installation with lifecycle scripts disabled, such as with --ignore-scripts, and explicitly document and review any scripts that are genuinely required.
  6. Run installation and validation in an isolated sandbox with minimal filesystem access, no unnecessary credentials, and restricted network access.
  7. Re-audit the pinned package, its lifecycle scripts, and its complete transitive dependency tree before deployment.
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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
Findings (2)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The activation criteria are extremely broad and include generic categories like development tasks, multi-step tasks, refactoring, and complex requirements. This can cause the skill to auto-activate for a very large fraction of user requests, increasing the chance that an agent enters a high-autonomy workflow when the user did not specifically intend it, which can amplify downstream risky behavior even though the file also contains some safety language.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The invocation guidance says to activate the skill whenever tasks match the listed conditions, but it does not provide scope boundaries or negative examples. In a skill designed for high-autonomy orchestration, this ambiguity makes accidental invocation more likely and can expand use into contexts where a simpler, less autonomous approach would be safer.

Content

No source excerpt is available for this finding.