Back to skill

Security audit

Approval Engine

Security checks for vulnerabilities and agentic risk

Overview

This skill is a real approval and alerting tool, but it has security-sensitive implementation flaws that could let approvals be bypassed or configuration execute code.

Review this carefully before installing in any real business workflow. Do not use it for approvals that affect money, customer commitments, permissions, or production operations until eval is removed, parallel approvals require all required approvers, webhook destinations are allowlisted, notification payloads are minimized, and local data files have restrictive permissions and retention controls.

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 (4)

T09 · Insecure Skill Coding Practices

Error
Location
src/approval-engine.js:136
Finding

Parallel approval workflow completes after a single non-rejecting decision

Content
View full analysis
d.level === approval.current_level); if (levelDecisions.length === 0) { return null; } // Parallel approval: any rejection rejects; otherwise approve if (rule.approval_type === 'parallel') { if (levelDecisions.some(d => d.decision === 'reject')) { return 'rejected'; } return 'approved'; } ``` The result is subsequently applied without checking whether all required parallel approvers have submitted decisions: ```javascript store.submitDecision(approvalId, approverId, approval.current_level, decision, comment); // Retrieve the updated approval record const updatedApproval = store.getApproval(approvalId); // Check the level result const levelResult = getLevelResult(updatedApproval, rule); if (levelResult === 'approved') { const nextLevel = getNextLevel(rule, approval.current_level); if (nextLevel) { store.updateApproval(approvalId, { current_level: nextLevel }); } else { store.updateApproval(approvalId, { status: 'approved' }); } } ``` ### Technical Analysis The module contains an `isLevelComplete()` function that verifies whether all required approvers have acted, but `submitApproval()` never invokes it before applying `getLevelResult()`. For a parallel rule, `getLevelResult()` returns `approved` whenever at least one decision exists and none of the submitted decisions equals `reject`. It does not compare the set of submitting approvers with the configured set of required approvers. The `decision` argument is also not restricted to an exact allowlist. Therefore, any decision other than the exact string `reject`, including an arbitrary value, is treated as approval by the parallel branch. ### Attack Path 1. A para ...[truncated 1051 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
src/rule-evaluator.js:208
Finding

Configuration-driven JavaScript execution through eval

Content
View full analysis
${expr} = ${result}`); return Boolean(result); } catch (error) { console.warn(`[RuleEvaluator] Failed to evaluate condition: ${triggerCondition}`, error.message); return false; } } ``` ### Technical Analysis The function executes the constructed expression with direct `eval()`. Comments describing the evaluation as safe do not impose any actual syntactic or semantic restrictions. There are two relevant injection sources: - `triggerCondition`, which can originate from rule configuration. - String values from `context`, which are inserted between single quotes without escaping embedded quotes or JavaScript syntax. The function is exported as part of the module API. If an attacker can alter approval configuration, call this exported function with a crafted condition, or influence a context st ...[truncated 1657 chars]
Remediation
View remediation
`, `<`, `>=`, `<=`, `==`, and `!=`. - Explicitly supported logical operators. 3. Resolve field references directly from `context` and `config`; never interpolate untrusted values into executable source text. 4. Reject unknown identifiers, property traversal outside approved roots, function calls, assignment, object construction, and other JavaScript syntax. 5. If a parser library is introduced, pin and review the dependency and configure it without access to process globals. 6. Treat the rule configuration as security-sensitive, make it read-only to the runtime account where practical, and validate it against a JSON schema before use. 7. Add negative tests containing quotes, semicolons, function calls, constructor access, and malformed expressions. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
src/escalation-handler.js:223
Finding

Unrestricted webhook URL permits SSRF and notification data disclosure

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
src/approval-store.js:57
Finding

Sensitive approval and exception context is persisted in plaintext without explicit access controls

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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (42)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

A generic retry/backoff or limited webhook helper is materially different from a full approval and anomaly-management system. Such overclaiming can lead to overprivileged deployment, unreviewed filesystem persistence, and misplaced trust in governance features that are absent.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

A generic retry/backoff or limited webhook helper is materially different from a full approval and anomaly-management system. Such overclaiming can lead to overprivileged deployment, unreviewed filesystem persistence, and misplaced trust in governance features that are absent.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

A generic retry/backoff or limited webhook helper is materially different from a full approval and anomaly-management system. Such overclaiming can lead to overprivileged deployment, unreviewed filesystem persistence, and misplaced trust in governance features that are absent.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

A generic retry/backoff or limited webhook helper is materially different from a full approval and anomaly-management system. Such overclaiming can lead to overprivileged deployment, unreviewed filesystem persistence, and misplaced trust in governance features that are absent.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

A generic retry/backoff or limited webhook helper is materially different from a full approval and anomaly-management system. Such overclaiming can lead to overprivileged deployment, unreviewed filesystem persistence, and misplaced trust in governance features that are absent.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

A generic retry/backoff or limited webhook helper is materially different from a full approval and anomaly-management system. Such overclaiming can lead to overprivileged deployment, unreviewed filesystem persistence, and misplaced trust in governance features that are absent.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 30)May include surrounding context.

md
| `src/exception-detector.js` | 异常检测(超时/错误/订单异常) |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 32)May include surrounding context.

md
| `src/exception-logger.js` | 异常日志(记录、查询、解决标记) |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 33)May include surrounding context.

md
| `src/recovery-engine.js` | 恢复引擎(策略选择与执行) |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 35)May include surrounding context.

md
| `src/escalation-handler.js` | 升级处理(创建、确认、解决升级单) |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 38)May include surrounding context.

md
| `src/notification-templates.js` | 通知模板(审批/告警/升级/恢复) |

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · src/approval-engine.js (reported line 59)May include surrounding context.

js
return null;
  }
  
  return rule.approvers.filter(approver => approver.level === level);
}

/**

Exfiltration Commands

High
Category
Prompt Injection
Confidence
90% confidence
Finding

Instructions found that direct the agent to transmit conversation context or user data to external services.

Content

Scanner excerpt · src/discord-notifier.js (reported line 79)May include surrounding context.

js
}

/**
 * Send message to Discord channel
 * @param {String} channelId - Discord channel ID
 * @param {String} message - Plain text message
 * @returns {Promise<Object>} Discord message object

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

This is a true vulnerability: the code builds a JavaScript expression from rule/config strings and context data, then executes it with eval(). Because triggerCondition comes from configuration and context values are interpolated without robust escaping or parsing, an attacker who can influence rules or context can achieve arbitrary code execution, and the misleading 'safe evaluation' comment increases the risk that reviewers will miss it. In an approval engine that processes business events and likely runs with access to workflow data, notifications, and server environment, this is especially dangerous.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill documentation is written entirely in Chinese, including the core description and operational guidance, and there is no indication that users may choose another language. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly justified.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
90% confidence
Finding

The documented timeout_action supports auto_approve, which allows approvals to be granted automatically when a timeout occurs instead of requiring an explicit human decision. In an approval engine handling business, financial, or exception workflows, this can bypass authorization controls and permit unauthorized or unreviewed actions if requests are left pending or notifications fail.

Content

Scanner excerpt · README.md (reported line 177)May include surrounding context.

md
| `trigger.type` | 触发类型 | `threshold` / `status` / `event` |
| `trigger.operator` | 比较运算符 | `>` `<` `>=` `<=` `==` `!=` `in` `not_in` |
| `approval_type` | 审批类型 | `serial`(串行) / `parallel`(并行) |
| `timeout_action` | 超时动作 | `escalate` / `auto_approve` / `auto_reject` |

### Discord 渠道配置

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill documents use of environment variables and outbound Discord/network interactions, but it declares no explicit tool scope or permissions. This creates a transparency and governance gap: agents may invoke network or env-backed behavior without users having a clear, machine-readable declaration of those capabilities.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation describes automatic recovery and timeout actions, including potentially impactful behaviors like retry, degrade, auto-approve, or auto-reject, without warning operators about the business consequences. In an approval engine, unattended automated actions can alter system state or bypass human review if misconfigured.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The documentation describes automatic recovery and timeout actions, including potentially impactful behaviors like retry, degrade, auto-approve, or auto-reject, without warning operators about the business consequences. In an approval engine, unattended automated actions can alter system state or bypass human review if misconfigured.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 148)May include surrounding context.

// 带自动重试执行异步函数(指数退避 + Jitter) const result = await retry.withRetry( async () => await fetch('https://api.example.com/orders'), { maxAttempts: 3, baseDelayMs: 1000, maxDelayMs: 10000 } );

text

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
89% confidence
Finding

The documented timeout handling includes autonomous outcomes such as auto_approve and auto_reject, which can make business decisions without human intervention. In an approval workflow context, that can authorize sensitive actions or deny legitimate ones due to timeout, misconfiguration, or attacker-induced delays.

Content

Scanner excerpt · SKILL.md (reported line 160)May include surrounding context.

// 检测超时审批并自动升级 const expired = await engine.checkTimeouts(); // expired[].action: 'escalate' | 'auto_approve' | 'auto_reject'

text

## Examples

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The file description and the user-facing notification titles and content are written in Chinese, indicating the skill is designed to communicate in a single language. The configuration does not offer any language selection, opt-in, or documented justification for the locale restriction.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The Discord and email templates include detailed customer, pricing, complaint, order, and internal handling data, which can expose sensitive business information and potentially personal data to notification channels. In an approval workflow this increases leakage risk through broad channel membership, webhook compromise, misrouting, or retention in third-party systems.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest describes an approval engine with exception handling, auto-recovery, and Discord notification integration. This file additionally enables SMTP/email notification as a first-class channel, including fallback use in recovery flows and email templates, which is a separate communication capability not mentioned in the stated purpose.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest mentions rule-driven approvals, exception detection, auto-recovery, and Discord notifications, but does not mention CRM/API integration. Enabling an OKKI API configuration introduces an external system integration capability that is not clearly justified by the declared skill purpose in the manifest.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.dynamic_code_execution, suspicious.env_credential_access

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
src/rule-evaluator.js:236

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
src/escalation-handler.js:224