Back to skill

Security audit

Backendenc

Security checks for vulnerabilities and agentic risk

Overview

This backend encryption skill is disclosed and local-only, but its implementation can break tenant isolation and write encrypted asset files outside the intended vault path.

Review this skill carefully before installing in any multi-user or security-sensitive backend. It should only be used with strictly validated, trusted userId, channelId, scope, and key values, and the path handling and tenant context format should be fixed before relying on its isolation claims.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (2)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/encryption-service.js:17
Finding

Ambiguous Tenant Context Construction Allows Cross-Tenant Key Collisions

Content
View full analysis
"a:b:c" userId = "a", channelId = "b:c" -> "a:b:c" ``` The resulting context is subsequently used to index: - In-memory master keys - In-memory key-encryption keys - In-memory data-encryption keys - Persistent salts - Wrapped KEKs - Wrapped DEKs - Non-asset encrypted records Consequently, logically distinct tenants can be mapped to the same cryptographic and storage namespace. The implementation does not independently verify that a context belongs to the authenticated caller. ### Attack Path 1. An attacker identifies or predicts a victim's `userId` and `channelId`. 2. The attacker supplies a crafted identifier containing `:` so that the attacker's identifier pair produces the same context string as the victim's pair. 3. The attacker invokes `unlock`, `save`, `load`, or encryption operations using the colliding identifiers. 4. If the colliding context is already unlocked in the same process, the service retrieves KEKs and DEKs from the shared in-memory maps. 5. The attacker can then target matching scopes and record keys in the shared namespace. 6. Depending on context state and operation order, the attacker may read or overwrite victim records, reuse active cryptographic material, or replace initialization data and deny the victim access. ### Impact Assessment A successful collision breaks the adv ...[truncated 622 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/encryption-service.js:94
Finding

Unsanitized Asset Identifiers Allow Filesystem Path Traversal

Content
View full analysis
Remediation
View remediation
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 (2)

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

Line L24 contains the Persian word "هر" embedded in otherwise English documentation. This imposes mixed-language instructions without opt-in or justification, which can violate language/locale policy and reduce clarity for users expecting a single language.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The comment at L008 uses Chinese for the explanatory note, and additional Chinese comments appear later in the file. Under the policy, forcing a specific language without user choice or documented justification can be a locale/language policy violation, even when it appears only in natural-language text within code.

Content

No source excerpt is available for this finding.