T09 · Insecure Skill Coding Practices
- Location
index.js:23- Finding
Sensitive-resource policy is not enforced by executable code
- Content
View full analysis
{ const data = { secret_hash: hash(secret), super_hash: hash(super_secret), sensitive_list: sensitive_list || [".env", "password", "config", "sudo"], dead_mans_switch: use_dead_mans_switch }; if (!fs.existsSync(path.dirname(STORE_PATH))) fs.mkdirSync(path.dirname(STORE_PATH), { recursive: true }); fs.writeFileSync(STORE_PATH, JSON.stringify(data)); logEvent("INITIALIZATION", "SUCCESS"); return `✅ MFA Word active. Mode: ${use_dead_mans_switch ? "Dead Man's Switch" : "15-min Window"}`; }; ``` ```javascript export const check_gate_status = () => { if (!fs.existsSync(STORE_PATH)) return { status: "LOCKED" }; const vault = JSON.parse(fs.readFileSync(STORE_PATH)); if (sessionState.isUnlocked && Date.now() < sessionState.expiry) { if (vault.dead_mans_switch) { sessionState.isUnlocked = false; logEvent("AUTO_LOCK", "DEAD_MAN_SWITCH_TRIGGERED"); return { status: "OPEN_ONCE" }; } return { status: "OPEN" }; } sessionState.isUnlocked = false; return { status: "LOCKED" }; }; ``` ### Technical Analysis The configured `sensitive_list` is persisted but never evaluated by any executable authorization mechanism. `check_gate_status` merely reports process-local state; it does not receive an operation, normalize a target path, evaluate whether a resource is sensitive, or intercept filesystem and command-execution tools. The protection therefore depends exclusively on an agent following the prose in `SKILL.md`. It is not an enforceable security boundary. Any code path, tool, ...[truncated 1083 chars]- Remediation
View remediation
