Back to skill

Security audit

EasyEDA API Skill

Security checks for vulnerabilities and agentic risk

Overview

This EasyEDA skill is purpose-aligned but opens an unauthenticated local bridge that can run arbitrary EasyEDA code against connected projects.

Use this only if you intentionally want an AI agent to control a running EasyEDA session. Start the bridge only while needed, close it afterward, avoid browsing untrusted sites while it runs, and treat connected EasyEDA projects as accessible to local software until the bridge adds authentication and origin restrictions.

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

Error
Location
scripts/bridge-server.mjs:124
Finding
Unauthenticated Local Bridge Permits Arbitrary Code Execution in EasyEDA<![CDATA[ ## Vulnerability Details **File Location**: `scripts/bridge-server.mjs:124-137, 198-219, 228-230, 272-287, 367-405, 459` **Vulnerability Type**: Unauthenticated arbitrary-code execution through a localhost HTTP/WebSocket bridge **Risk Level**: High The bridge intentionally accepts JavaScript and forwards it to a connected EasyEDA client, but it does not authenticate or authorize HTTP clients, WebSocket agents, or registering EDA clients. Although the server listens only on `127.0.0.1`, any local process can access it. A malicious web page may also target it because wildcard CORS is enabled and WebSocket origins are not validated. ### Vulnerable Code From `scripts/bridge-server.mjs:124-137`: ```javascript const httpServer = createServer(async (req, res) => { // CORS res.setHeader('Access-Control-Allow-Origin', '*'); res.setHeader('Access-Control-Allow-Methods', 'POST, GET, OPTIONS'); res.setHeader('Access-Control-Allow-Headers', 'Content-Type'); if (req.method === 'OPTIONS') { res.writeHead(204); res.end(); return; } ``` From `scripts/bridge-server.mjs:198-219`: ```javascript // Execute code on EDA if (req.method === 'POST' && req.url === '/execute') { let body = ''; for await (const chunk of req) body += chunk; try { const payload = JSON.parse(body); const code = payload.code; const windowId = payload.windowId; // optional, uses active window if not specified if (!code || typeof code !== 'string') { res.writeHead(400, { 'Content-Type': 'application/json' }); res.end(JSON.stringify({ error: 'Missing "code" field (string)' })); return; } const result = await executeOnEda(code, windowId); res.writeHead(200, { 'Content-Type': 'application/json' }); res.end(JSON.stringify({ success: true, result, windowId: windowId || activeEdaWindowId })); } catch (err) { ``` From `scripts/bridge-server.mjs:228-230`: ```javascript // ─── WebSocket Server ────────────────────────── ...[truncated 5285 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Require strong authentication** - Generate a cryptographically random token when the bridge starts. - Require the token in an authorization header for every HTTP request. - Require an authenticated initialization message or token-bearing WebSocket subprotocol for every WebSocket connection. - Never place the token in URLs, logs, or health responses. 2. **Authenticate the EasyEDA gateway** - Pair the gateway with the bridge using a one-time server-issued nonce or user-approved secret. - Reject unauthenticated `register` messages. - Bind each registered window ID to the authenticated connection that created it. - Prevent duplicate or attacker-selected window IDs from silently replacing legitimate entries. 3. **Restrict browser access** - Remove `Access-Control-Allow-Origin: *`. - Disable CORS unless browser-based clients are explicitly required. - If browser access is necessary, use a strict origin allowlist and reject `null` or unrecognized origins. - Validate the `Origin` header during WebSocket upgrades. 4. **Replace unrestricted code execution** - Prefer a structured RPC protocol with an allowlist of supported EasyEDA operations. - Validate operation names, parameter types, document targets, and permitted data sizes. - Separate read-only operations from mutating or destructive operations. - If arbitrary code remains necessary for debugging, make it an explicit temporary mode that is disabled by default. 5. **Require user confirmation** - Display the requested operation and target EasyEDA window before executing arbitrary, mutating, file-related, or destructive actions. - Use short-lived approvals rather than granting permanent access for the entire bridge lifetime. 6. **Harden request processing** - Set maximum HTTP body and WebSocket message sizes. - Add rate limiting and connection limits. - Apply strict JSON schema validation. - Reject missing, malf ...[truncated 737 chars]
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (760)

Vague Triggers

High
Confidence
98% confidence
Finding
The trigger list contains very broad terms such as "EasyEDA", "PCB", "EDA", "schematic", and "circuit board", which can cause the skill to activate in unrelated conversations. Because this skill can start a local bridge and execute code in a running EasyEDA client, accidental activation materially increases the chance of unintended code execution or environment manipulation.

Ae1

High
Category
analysis-evasion
Content
- [references/_quick-reference.md](references/_quick-reference.md) — All method signatures for rapid lookup
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- [references/_quick-reference.md](references/_quick-reference.md) — All method signatures for rapid lookup
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
- [references/_quick-reference.md](references/_quick-reference.md) — All method signatures for rapid lookup
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
10. Future logic support: `["AND", ["NET", "GND"], ["LAYER", 5]]`
4. ruleOrder priority: the smaller the value, the higher the priority. Recommended:
    - `0` component rule
    - `1` footprint rule
    - `2` region rule
    - `3` net-net rule
    - `4` net rule
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Credential Access

High
Category
Privilege Escalation
Content
| Symptom | How to handle |
| --- | --- |
| Network timeout / cannot fetch packages (common on mainland China networks) | Edit the `.npmrc` inside the project, uncomment `registry=https://registry.npmmirror.com`, and retry. **Only edit the project-level `.npmrc`; never modify the global npm configuration without consent** |
| On Windows: `...ps1 cannot be loaded because running scripts is disabled on this system` (wording may be localized) | First try `Set-ExecutionPolicy -Scope CurrentUser RemoteSigned` (affects only the current user, no administrator privileges needed); if that still fails, ask the user to run `Set-ExecutionPolicy RemoteSigned` in an administrator PowerShell themselves. The AI must not attempt to elevate privileges on its own |

### 3.4 Configure `extension.json`
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
| Symptom | How to handle |
| --- | --- |
| Network timeout / cannot fetch packages (common on mainland China networks) | Edit the `.npmrc` inside the project, uncomment `registry=https://registry.npmmirror.com`, and retry. **Only edit the project-level `.npmrc`; never modify the global npm configuration without consent** |
| On Windows: `...ps1 cannot be loaded because running scripts is disabled on this system` (wording may be localized) | First try `Set-ExecutionPolicy -Scope CurrentUser RemoteSigned` (affects only the current user, no administrator privileges needed); if that still fails, ask the user to run `Set-ExecutionPolicy RemoteSigned` in an administrator PowerShell themselves. The AI must not attempt to elevate privileges on its own |

### 3.4 Configure `extension.json`
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Hidden Instructions

High
Category
Prompt Injection
Content
## Remarks

If the specified board does not exist, the API will return `false`<!-- -->, indicating that the operation failed

## Example
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Hidden Instructions

High
Category
Prompt Injection
Content
## Remarks

If the specified board does not exist, the API will return `false`<!-- -->, indicating that the operation failed

## Example
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Hidden Instructions

High
Category
Prompt Injection
Content
Promise&lt;[IDMT\_BoardItem](../interfaces/IDMT_BoardItem.md) \| undefined&gt;

Board detailed properties of; if it is `undefined`<!-- -->, the retrieval failed

## Example
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Hidden Instructions

High
Category
Prompt Injection
Content
Promise&lt;[IDMT\_BoardItem](../interfaces/IDMT_BoardItem.md) \| undefined&gt;

Board detailed properties of; if it is `undefined`<!-- -->, the retrieval failed

## Example
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Hidden Instructions

High
Category
Prompt Injection
Content
</td><td>

Tab ID. Here [IDMT\_SchematicPageItem.uuid](../interfaces/IDMT_SchematicPageItem.md)<!-- -->, [IDMT\_PcbItem.uuid](../interfaces/IDMT_PcbItem.md)<!-- -->, and [IDMT\_PanelItem.uuid](../interfaces/IDMT_PanelItem.md) are supported as input

</td></tr>
</tbody></table>
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Hidden Instructions

High
Category
Prompt Injection
Content
Promise&lt;[IDMT\_EditorSplitScreenItem](../interfaces/IDMT_EditorSplitScreenItem.md) \| undefined&gt;

The editor split screen property tree. If it is `undefined`<!-- -->, the data retrieval failed

## Example
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Hidden Instructions

High
Category
Prompt Injection
Content
Promise&lt;[IDMT\_EditorSplitScreenItem](../interfaces/IDMT_EditorSplitScreenItem.md) \| undefined&gt;

The editor split screen property tree. If it is `undefined`<!-- -->, the data retrieval failed

## Example
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Hidden Instructions

High
Category
Prompt Injection
Content
</td><td>

Document UUID. Here [IDMT\_SchematicItem.uuid](../interfaces/IDMT_SchematicItem.md)<!-- -->, [IDMT\_SchematicPageItem.uuid](../interfaces/IDMT_SchematicPageItem.md)<!-- -->, [IDMT\_PcbItem.uuid](../interfaces/IDMT_PcbItem.md)<!-- -->, and [IDMT\_PanelItem.uuid](../interfaces/IDMT_PanelItem.md) are supported as input

</td></tr>
<tr><td>
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Hidden Instructions

High
Category
Prompt Injection
Content
Promise&lt;string \| undefined&gt;

Tab ID, if it is `undefined`<!-- -->, then open document failed

## Example
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Hidden Instructions

High
Category
Prompt Injection
Content
Promise&lt;string \| undefined&gt;

Tab ID, if it is `undefined`<!-- -->, then open document failed

## Example
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Hidden Instructions

High
Category
Prompt Injection
Content
Promise&lt;[IDMT\_FolderItem](../interfaces/IDMT_FolderItem.md) \| undefined&gt;

Folder property; if it is `undefined`<!-- -->, the retrieval failed

## Remarks
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Hidden Instructions

High
Category
Prompt Injection
Content
Promise&lt;string \| undefined&gt;

New panel UUID. If it is `undefined`<!-- -->, the copy failed

## Example
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Hidden Instructions

High
Category
Prompt Injection
Content
Promise&lt;string \| undefined&gt;

New panel UUID. If it is `undefined`<!-- -->, the copy failed

## Example
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Hidden Instructions

High
Category
Prompt Injection
Content
Promise&lt;[IDMT\_PanelItem](../interfaces/IDMT_PanelItem.md) \| undefined&gt;

Panel detailed properties of; if it is `undefined`<!-- -->, the retrieval failed

## Remarks
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Hidden Instructions

High
Category
Prompt Injection
Content
Promise&lt;[IDMT\_PanelItem](../interfaces/IDMT_PanelItem.md) \| undefined&gt;

Panel detailed properties of; if it is `undefined`<!-- -->, the retrieval failed

## Remarks
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Hidden Instructions

High
Category
Prompt Injection
Content
Promise&lt;string \| undefined&gt;

New PCB UUID. If it is `undefined`<!-- -->, the copy failed

## Remarks
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Hidden Instructions

High
Category
Prompt Injection
Content
Promise&lt;[IDMT\_PcbItem](../interfaces/IDMT_PcbItem.md) \| undefined&gt;

PCB detailed properties of; if it is `undefined`<!-- -->, the retrieval failed

## Remarks
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Hidden Instructions

High
Category
Prompt Injection
Content
Promise&lt;[IDMT\_PcbItem](../interfaces/IDMT_PcbItem.md) \| undefined&gt;

PCB detailed properties of; if it is `undefined`<!-- -->, the retrieval failed

## Remarks
Confidence
70% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Static analysis

No suspicious patterns detected.