Back to skill

Security audit

Event Orchestrator

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent in-process event orchestration library with no hidden OS, network, credential, or persistence behavior, but it has dependency hygiene issues and a real rate-limit implementation bug.

Install only if you are comfortable with a Chinese-language Node.js library for in-process orchestration. Update the dev dependency lockfile before using it in CI, avoid feeding untrusted config or source files into its tooling until patched, and fix the middleware dispatch bug before relying on the built-in rate limiter as a security control.

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
src/event-bus.js:116
Finding
Object-Style Middleware Invocation Failure Causes Rate-Limit Bypass<![CDATA[ ## Vulnerability Details **File Location**: `src/event-bus.js:116-125` and `src/index.js:38-46` **Vulnerability Type**: Fail-open middleware integration and rate-limit bypass **Risk Level**: Medium ### Vulnerable Code `src/index.js:38-46` registers middleware as objects whose behavior is exposed through a `handle(event)` method: ```javascript _registerDefaultMiddleware() { // 日志中间件 this.eventBus.use(new LoggingMiddleware({ logLevel: 'info' })); // 速率限制中间件 this.eventBus.use(new RateLimitMiddleware({ maxEvents: 100, windowMs: 60000 })); } ``` However, `src/event-bus.js:116-125` invokes every registered middleware value as a function: ```javascript let shouldContinue = true; for (const middleware of this.middlewareChain) { try { const result = await middleware(event); if (result === false) { shouldContinue = false; break; } } catch (error) { console.error(`Middleware error: ${error.message}`); } } ``` ### Technical Analysis `LoggingMiddleware` and `RateLimitMiddleware` are class instances that expose an asynchronous `handle(event)` method. They are not callable JavaScript functions. Consequently, the expression `middleware(event)` throws a `TypeError` whenever one of these default middleware objects is processed. The exception is caught and only logged. Event processing then continues with the next middleware and ultimately reaches event history and subscribers. This fail-open behavior means the default rate limiter never counts or blocks events, despite being enabled by the orchestrator constructor. The standalone `MiddlewareChainExecutor` elsewhere in the project correctly distinguishes between object-style and function-style middleware, but `EventBus.publish()` does not implement the same dispatch logic. Tests exercise middleware classes directly without confirming that object-style middleware is invoked through the integrated `EventOrchestrator.publish()` path. ### Attack Path 1. An atta ...[truncated 1575 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Support the documented object-style middleware interface explicitly: ```javascript for (const middleware of this.middlewareChain) { let result; if (middleware && typeof middleware.handle === 'function') { result = await middleware.handle(event); } else if (typeof middleware === 'function') { result = await middleware(event); } else { throw new TypeError('Middleware must be a function or expose handle(event)'); } if (result === false) { return { eventId, status: 'skipped', reason: 'middleware_blocked' }; } } ``` 2. Validate middleware in `EventBus.use()` so malformed middleware is rejected at registration time rather than failing during publication: ```javascript use(middleware) { const valid = typeof middleware === 'function' || (middleware && typeof middleware.handle === 'function'); if (!valid) { throw new TypeError('Invalid middleware'); } this.middlewareChain.push(middleware); } ``` 3. Define an explicit failure policy. Security controls such as rate limiting and validation should fail closed rather than allowing publication after an internal middleware error. 4. Avoid swallowing middleware exceptions without classification. Return a failed publication result or propagate the exception when a mandatory middleware component fails. 5. Add integration tests through `EventOrchestrator.publish()` that verify: - Object-style middleware has its `handle()` method invoked. - The 101st same-name event within 60 seconds is blocked by default. - A middleware result of `false` prevents history insertion and subscriber dispatch. - Invalid middleware is rejected during registration. - Mandatory middleware exceptions do not permit event delivery. ]]>
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (23)

Known Vulnerable Dependency: js-yaml==3.14.2 — 4 advisory(ies): CVE-2026-84375 (js-yaml: maxTotalMergeKeys does not limit CPU use for empty merge sources); CVE-2026-59869 (js-yaml: YAML merge-key chains can force quadratic CPU consumption); GHSA-5p4m-2wfm-xmqj (JS-YAML: Quadratic CPU consumption in !!omap resolution (3.x and 4.x) — CVE-2026) +1 more

High
Category
Supply Chain
Confidence
92% confidence
Finding
js-yaml 3.14.2 is flagged with multiple CPU consumption/DoS advisories involving crafted YAML merge structures and omap resolution. Although this instance is nested under a dev dependency path, parsing attacker-controlled YAML in tooling, CI, or local developer workflows could still cause excessive resource consumption or hangs.

Known Vulnerable Dependency: brace-expansion==1.1.13 — 3 advisory(ies): CVE-2026-13149 (brace-expansion: DoS via exponential-time expansion of consecutive non-expanding); CVE-2026-14257 (brace-expansion: DoS via unbounded expansion length causing an out-of-memory pro); CVE-2026-69152 (brace-expansion: DoS via unbounded intermediate arrays, bypassing the CVE-2026-1)

High
Category
Supply Chain
Confidence
90% confidence
Finding
brace-expansion 1.1.13 is associated with multiple denial-of-service issues due to pathological expansion behavior and memory growth. Even though it is transitive and dev-only here, many file-matching and CLI workflows consume attacker-influenced patterns, so malformed input could degrade developer tools or CI jobs.

Known Vulnerable Dependency: browserslist==4.28.2 — 2 advisory(ies): CVE-2026-73088 (Browserslist: Uncaught crash / prototype write via untrusted browserslist-stats.); CVE-2026-73089 (Browserslist: Unbounded memory growth (no cache eviction) via distinct query res)

High
Category
Supply Chain
Confidence
88% confidence
Finding
browserslist 4.28.2 is flagged for crash/prototype-write and unbounded memory growth issues when given untrusted stats or distinct query inputs. In this project it is part of the development toolchain, so it is less severe than a production runtime dependency, but still a real risk for build systems or automation that ingest external configuration or stats data.

Known Vulnerable Dependency: js-yaml==4.1.1 — 4 advisory(ies): CVE-2026-84375 (js-yaml: maxTotalMergeKeys does not limit CPU use for empty merge sources); CVE-2026-59869 (js-yaml: YAML merge-key chains can force quadratic CPU consumption); GHSA-5p4m-2wfm-xmqj (JS-YAML: Quadratic CPU consumption in !!omap resolution (3.x and 4.x) — CVE-2026) +1 more

High
Category
Supply Chain
Confidence
92% confidence
Finding
js-yaml 4.1.1 carries the same family of YAML parser CPU exhaustion issues as the 3.x finding, so this is not a false positive merely because another version is also present. In this lockfile it is used by developer tooling, which reduces blast radius but still leaves CI or local automation vulnerable to denial of service when handling attacker-controlled YAML.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
This markdown file documents `getEventHistory`, `clear()`, and `exportState()` but provides no warning that these operations may expose historical event data or remove all stored orchestrator state. For markdown files, missing warnings about behaviors affecting user data or system integrity should be flagged.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The manifest mixes English naming with Chinese display text, description, tags, and category, but provides no indication that the skill is region-specific or that users can opt into this locale. That creates a natural-language policy concern because the skill presentation appears to enforce a specific language by default.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
This markdown file contains user-facing natural language throughout, and it consistently forces a single language/locale experience. Under the policy, language constraints should either provide user opt-in/choice or be clearly justified as region-specific, which is not present here.

Natural-Language Policy Violations

Low
Confidence
81% confidence
Finding
The file presents all user-facing instructions in a single language and does not offer an opt-in language choice or explain that the skill is intentionally region/language-specific. This can violate the language/locale policy when no justification or alternative is provided.

Natural-Language Policy Violations

Low
Confidence
77% confidence
Finding
This markdown file presents the skill name, description, commands, and usage guidance entirely in Chinese. Under the language/locale policy, forcing a specific language without offering the user a choice or documenting the locale constraint can be a natural-language policy violation.

Natural-Language Policy Violations

Low
Confidence
84% confidence
Finding
The document sets `lang="en"` at L003, which is a natural-language locale choice applied globally to the page. In this file there is no accompanying user opt-in or justification for enforcing English, while the embedded content itself includes Chinese text, making the fixed locale inconsistent and potentially contrary to a language-choice policy.

Natural-Language Policy Violations

Low
Confidence
90% confidence
Finding
The natural-language comments and descriptive text for the main entry file are written in Chinese, including the file purpose and architectural description. This imposes a specific language context with no indication of user opt-in, alternative locale support, or documented justification for a region-specific skill.

Natural-Language Policy Violations

Low
Confidence
93% confidence
Finding
The comments and descriptive text in this file are written in Chinese, such as the title and middleware descriptions, with no indication that the skill is region-specific or that users can opt into this language. Under the stated policy, forcing a specific language without user choice is a natural-language locale policy issue.

Natural-Language Policy Violations

Low
Confidence
95% confidence
Finding
The HTML document declares lang="en" on L003, but the embedded visible text and code comments for the covered file are largely in Chinese later in the page. This creates a locale/language policy concern because the file forces an English language setting without offering user choice or reflecting the actual content language.

Known Vulnerable Dependency: @babel/core==7.29.0 — 1 advisory(ies): CVE-2026-49356 (@babel/core: Arbitrary File Read via sourceMappingURL Comment)

Low
Category
Supply Chain
Confidence
78% confidence
Finding
The lockfile pins @babel/core 7.29.0, which the supplied finding states is affected by an arbitrary file read issue via sourceMappingURL comment handling. In this skill context it is a development/test dependency rather than runtime application code, so exploitability is narrower, but it is still a real supply-chain risk if untrusted source files are processed during builds or tests.

Known Vulnerable Dependency: baseline-browser-mapping==2.10.17 — 1 advisory(ies): CVE-2026-45819 (baseline-browser-mapping process termination on invalid input causes denial of s)

Low
Category
Supply Chain
Confidence
74% confidence
Finding
baseline-browser-mapping 2.10.17 is reported vulnerable to invalid-input-triggered process termination. This appears to be a legitimate dependency issue, but in this lockfile it is a dev-only package used indirectly by browserslist-related tooling, making the practical risk mostly limited to denial of service in build or analysis workflows.

Natural-Language Policy Violations

Low
Confidence
93% confidence
Finding
The package description is written only in Chinese, which imposes a specific language choice in user-facing metadata. Under the stated policy, a forced language or locale without offering user choice or documenting a justified regional scope is a natural-language policy concern.

Unpinned Dependencies

Low
Category
Supply Chain
Content
"author": "王的奴隶 · 严谨专业版",
  "license": "MIT",
  "devDependencies": {
    "jest": "^29.0.0",
    "eslint": "^8.0.0"
  },
  "jest": {
Confidence
40% confidence
Finding
Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Unpinned Dependencies

Low
Category
Supply Chain
Content
"license": "MIT",
  "devDependencies": {
    "jest": "^29.0.0",
    "eslint": "^8.0.0"
  },
  "jest": {
    "testEnvironment": "node",
Confidence
40% confidence
Finding
Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Natural-Language Policy Violations

Low
Confidence
92% confidence
Finding
The file header and descriptive comments use Chinese exclusively, which is a natural-language locale choice embedded in the skill artifact. Under the policy, forcing a specific language without user opt-in or a documented regional justification is a policy concern.

Natural-Language Policy Violations

Low
Confidence
83% confidence
Finding
This code file contains user-facing natural-language comments in Chinese, such as the module description and class documentation, but provides no indication that the language is configurable or intentionally region-specific. Under the stated policy, forcing a specific language without user opt-in can be a natural-language policy violation.

Natural-Language Policy Violations

Low
Confidence
92% confidence
Finding
This JavaScript test file uses Chinese-only natural-language comments and test descriptions, such as the header comment and subsequent describe/test labels. Under the stated policy, forcing a specific language without user opt-in or documented regional justification is a natural-language policy issue.

Natural-Language Policy Violations

Low
Confidence
90% confidence
Finding
This JavaScript test file contains natural-language comments and test descriptions in Chinese throughout, which effectively forces a specific language for maintainers and users interacting with the skill artifacts. The stated policy flags locale or language constraints when no opt-in or justification is provided.

Natural-Language Policy Violations

Low
Confidence
94% confidence
Finding
This JavaScript test file uses Chinese natural-language strings throughout comments and test descriptions, which imposes a specific language on users and maintainers. Under the policy, language-specific behavior is only acceptable when the skill offers opt-in or clearly documents a justified locale constraint, neither of which is present in this file.

Static analysis

No suspicious patterns detected.