Back to skill

Security audit

loci

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed local memory tool; its main caution is that saved memories are plaintext local files, so users should avoid storing secrets.

Install only if you want an agent-accessible long-term memory file. Do not store API keys, passwords, tokens, or highly sensitive personal or business data unless you have checked that the palace file and parent directory are private to your account.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/loci.mjs:36
Finding
Palace Memory File Is Written Without Explicit Restrictive Permissions## Vulnerability Details **File Location**: `scripts/loci.mjs`, lines 36–38 **Vulnerability Type**: Plaintext sensitive data stored with inherited file permissions **Risk Level**: Medium ### Vulnerable Code ```js function savePalace(data, path) { const jsonPath = path.endsWith('.yaml') ? path.replace('.yaml', '.json') : path; writeFileSync(jsonPath, JSON.stringify(data, null, 2), 'utf8'); } ``` ### Technical Analysis The application persists the complete memory palace as plaintext JSON by calling `writeFileSync` without specifying a restrictive file mode. When the destination does not already exist, its effective permissions are determined by the runtime defaults and the process umask rather than being explicitly limited to the file owner. The stored data can include user preferences, relationships, project decisions, environment details, and other long-lived agent context. On a multi-user system with permissive directory and file permissions, another local account may be able to read this information. The code also does not inspect or correct the permissions of an existing palace file. Exploitation depends on local filesystem access and sufficiently permissive permissions. The audited code does not transmit the file over a network and does not grant remote access by itself. ### Attack Path 1. A user initializes a palace or runs a command that saves palace data. 2. `savePalace` writes the serialized memory data without an explicit owner-only mode. 3. The resulting permissions are inherited from the process environment and umask. 4. If those permissions and the parent directory permissions permit access, another local account reads `loci_palace.json`. 5. The local account obtains the stored memory contents, including any private context placed in the palace. ### Impact Assessment The issue can disclose all memories stored in the affected palace file to another local user who already has ...[truncated 219 chars]
Remediation
## Remediation Suggestions - Create the palace file with an explicit owner-only mode: ```js writeFileSync(jsonPath, JSON.stringify(data, null, 2), { encoding: 'utf8', mode: 0o600, }); ``` - Correct permissions on existing files, because the creation mode does not change an already existing file: ```js chmodSync(jsonPath, 0o600); ``` - Verify that the parent palace directory is restricted to the owning user, preferably with mode `0o700`. - Use an atomic write strategy: write to an owner-only temporary file in the same directory, flush it, and rename it over the destination. - Reject symbolic-link destinations or validate the resolved destination where untrusted local users can modify the parent directory. - Document that credentials, API keys, authentication tokens, and other secrets should not be stored in the palace.
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
Findings (1)

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The initialized default configuration sets all visible domain names to Chinese strings such as 工作, 知识, and 人际. This imposes a specific language/locale on users by default, and the file does not offer an opt-in, language selection, or justification for the locale restriction.

Static analysis

No suspicious patterns detected.