Back to skill

Security audit

opencli-adapter-author

Security checks for vulnerabilities and agentic risk

Overview

The skill fits its adapter-writing purpose, but it guides agents to use logged-in browser sessions and persist captured API data in ways that can expose private account information.

Install only if you trust the workflow with the browser profile you use for target sites. Prefer running it in a separate browser profile or test account, avoid private endpoints unless you explicitly intend to use them, review any generated fixtures or cached captures for personal data, and delete ~/.opencli cache/site artifacts when finished.

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

T09 · Insecure Skill Coding Practices

Warning
Location
references/api-discovery.md:214
Finding

Broad Enumeration Exposes Browser Session Secrets

Content
View full analysis

Vulnerability Details

File Location: references/api-discovery.md, lines 214–232
Vulnerability Type: Excessive disclosure of authentication material
Risk Level: Medium

Vulnerable Code

bash
opencli browser eval "document.cookie.split('; ').reduce((o,x)=>{const[k,v]=x.split('=');o[k]=v;return o},{})"
bash
opencli browser eval "Object.keys(localStorage).map(k=>k+' => '+localStorage.getItem(k).slice(0,50))"

Technical Analysis

The API-discovery workflow instructs the Agent to print every script-readable cookie and the first 50 characters of every localStorage value. This is broader than necessary to determine whether a particular endpoint requires a known cookie, CSRF token, JWT, or other authentication value.

An authenticated page may store unrelated session credentials, bearer tokens, account identifiers, or application secrets in these locations. Returning those values through opencli browser eval places them in Agent-visible tool output and potentially in conversation histories, diagnostic traces, terminal logs, or other retained artifacts.

The cookie command does not expose HttpOnly cookies, but it exposes all non-HttpOnly cookie values without filtering. The storage command truncates values but can still reveal complete short secrets or security-sensitive token prefixes.

No evidence shows that these secrets are transmitted to an attacker-controlled destination. The issue is unnecessary secret disclosure rather than confirmed network exfiltration.

Attack Path

  1. A user invokes the Skill while using an authenticated browser session.
  2. Endpoint replay returns an authentication-related error, causing the Agent to enter the token-discovery workflow.
  3. The Agent executes the documented cookie or localStorage enumeration command.
  4. All accessible cookie values or storage-value prefixes are returned in tool output.
  5. Unrelated authentication material becomes available in Agent context and may be retaine ...[truncated 761 chars]
Remediation
View remediation

Remediation Suggestions

  1. Enumerate cookie and storage names only during initial discovery:
    bash
    opencli browser eval "document.cookie.split('; ').map(x=>x.split('=')[0])"
    
    bash
    opencli browser eval "Object.keys(localStorage)"
    
  2. Retrieve a value only after identifying the exact key required by the observed endpoint.
  3. Redact values by default, showing only metadata such as presence and length.
  4. Never print bearer tokens, session cookies, JWTs, or CSRF values into Agent output.
  5. Require explicit user confirmation before inspecting authentication-storage values.
  6. Ensure traces and command logs apply secret redaction and use short retention periods.
  7. Prefer a dedicated helper that returns only the selected key directly to the request-building operation without exposing the value to conversational output.

T09 · Insecure Skill Coding Practices

Warning
Location
references/api-discovery.md:88
Finding

Authenticated Network Response Bodies Are Persisted Without Mandatory Sanitization

Content
View full analysis

Vulnerability Details

File Location: references/api-discovery.md, lines 88–104
Vulnerability Type: Plaintext retention of potentially sensitive network data
Risk Level: Medium

Vulnerable Code

text
- capture still persists the complete set, so a later `--detail <key>` can find entries excluded by filtering
bash
opencli browser network --detail <key>
text
capture is persisted to `~/.opencli/cache/browser-network/<session>.json`
(default TTL 24h)

Technical Analysis

The discovery process records network captures and persists them under the user's home directory for 24 hours. It also permits retrieval of complete response bodies. Because the workflow supports cookie-authenticated APIs, these bodies may contain private messages, account details, tenant data, email addresses, telephone numbers, user identifiers, or response-embedded credentials.

The project contains appropriate sanitization requirements for long-term fixtures in SKILL.md and references/site-memory.md, but the network-cache instructions do not state that response bodies are redacted before persistence. This creates an inconsistent security boundary: data must be sanitized before fixture storage, while temporary network captures may retain the unsanitized source material.

The finding is limited to local plaintext retention. The audited files do not show these captures being uploaded or sent to an attacker-controlled service.

Attack Path

  1. A user runs discovery in a browser session authenticated to the target site.
  2. The page issues requests to private or account-specific APIs.
  3. opencli browser network captures the responses, including entries not shown by output filters.
  4. The capture is written to ~/.opencli/cache/browser-network/&lt;session&gt;.json.
  5. Complete response bodies remain available for up to 24 hours.
  6. Another local process, user, backup service, diagnostic collector, or later Agent operation reads the cache.
  7. Se ...[truncated 714 chars]
Remediation
View remediation

Remediation Suggestions

  1. Store only request metadata and response-shape summaries by default.
  2. Make complete-body capture an explicit opt-in operation with a warning for authenticated sessions.
  3. Apply automatic redaction before disk writes, covering:
    • Cookies and authorization headers
    • Bearer tokens and JWTs
    • CSRF tokens
    • Email addresses and telephone numbers
    • User IDs, account names, and tenant identifiers
    • Known site-specific authentication fields
  4. Restrict cache files and parent directories to the owning user, such as mode 0600 for files and 0700 for directories.
  5. Provide a zero-retention mode and an immediate secure-delete command.
  6. Shorten the default retention period for complete bodies and delete captures when the discovery operation ends.
  7. Clearly extend the fixture sanitization rules in SKILL.md and references/site-memory.md to browser-network caches.
  8. Avoid collecting bodies from endpoints classified as private unless the target endpoint is explicitly selected.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (22)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| `references/adapter-template.md` | Step 9 文件结构 + 活例子 `convertible.js` |

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| `references/jsdom-fixture-pattern.md` | 当 adapter 走 `page.evaluate` 内 DOM 抽取、且 mocked-evaluate 单测漏 silent bug 时——把 HTML 冻进 `clis/<site>/__fixtures__/` 用 JSDOM

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
| `references/jsdom-fixture-pattern.md` | 当 adapter 走 `page.evaluate` 内 DOM 抽取、且 mocked-evaluate 单测漏 silent bug 时——把 HTML 冻进 `clis/<site>/__fixtures__/` 用 JSDOM

Ssd 4

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill explicitly escalates from normal API inspection to techniques for defeating access controls and capturing authenticated traffic, including interceptor-based man-in-the-browser behavior. In the context of an adapter-authoring skill, this materially increases the chance that an agent will extract protected data or operationalize scraping against sites that rely on browser-side protections, CORS boundaries, or signed requests.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The file directs the agent to enumerate cookies, localStorage, session storage, and to reuse authentication artifacts such as CSRF tokens and session cookies. That creates a clear path for credential harvesting and replay, especially because the instructions distinguish HttpOnly handling and root-domain cookie lookup, which are operational details useful for abuse rather than mere observation.

Content

No source excerpt is available for this finding.

Ssd 1

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The guidance frames direct store-method invocation as a way to bypass request-signing logic by causing the page to generate signatures internally. That is dangerous because it operationalizes circumvention of anti-abuse controls while hiding the signing mechanism behind legitimate page code, making protected endpoints easier to access without understanding or honoring intended restrictions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The instructional content is written entirely in Chinese and directly addresses the agent in Chinese, which effectively imposes a language choice for use of the skill. Under the policy, language constraints should either provide user opt-in/choice or clearly document why the locale restriction is necessary.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill directs storing full endpoint response samples in fixtures and only says to remove cookies, tokens, and private user fields, without a strong privacy gate or minimization rule. Endpoint responses often contain personal, account, or business-sensitive data beyond obvious auth material, so preserving full samples can leak sensitive information into durable local storage and potentially into repos or later tooling flows.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The example code explicitly sets Accept-Language: 'zh-CN,zh;q=0.9', which forces a specific locale in outbound requests. This is a natural-language locale policy concern because the file does not indicate user choice, opt-in, or a region-specific justification for always using Chinese.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

This markdown file presents its operational instructions entirely in Chinese and does not offer an alternative language or indicate that the skill is intentionally limited to Chinese-speaking users. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This markdown file is written entirely in Chinese and gives operational instructions in Chinese without offering a language option or documenting a justified locale restriction. The policy requires flagging language or locale constraints when they are imposed without user opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The document's operative instructions are written entirely in Chinese, beginning with direct workflow guidance at L003. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly documented and justified, which this file does not do.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The guidance explicitly requires camelCase,全英文, which is a natural-language locale policy constraint. The document does not present this as optional, user-selectable, or justified as a region-specific compliance requirement, so it appears to force a specific language convention without opt-in.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill guidance and operational instructions are presented exclusively in Chinese throughout the file. Under the language/locale policy, forcing a single language without user opt-in or a documented regional justification is a natural-language policy issue.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This markdown file documents default authentication via browser cookies and identifies login-state cookies such as SESSDATA and bili_jct, then later lists endpoints for watch history and favorites that require login. Under the markdown-specific warning rule, the skill description should warn users that it may access account-linked private data and browser-authenticated sessions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The entire skill reference is written in Chinese and provides no indication that users may choose another language or that the locale restriction is intentional. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The document explicitly instructs adapter authors to use browser-backed authenticated requests where fetch(..., { credentials: 'include' }) automatically carries the user's Xueqiu cookies, and notes that login cookies may contain user identity. In a skill that guides creation of adapters and data-access flows, this creates a real privacy and account-data risk because it normalizes silent use of authenticated session state without requiring user consent, warning, or scope limitations, especially for endpoints marked as login-required such as portfolio/watchlist access.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This markdown file presents the operational guidance entirely in Chinese, including headings, instructions, and decision steps, with no indication that the user can choose another language or that the skill is intentionally restricted to a Chinese-speaking audience. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file presents all operational guidance in Chinese and does not indicate that language selection is optional or user-configurable. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The document content is written in Chinese and includes normative guidance, but it does not state that the language is optional, user-selectable, or justified by a region-specific scope. Under the policy, forcing a specific language without opt-in is a natural-language locale violation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill explicitly instructs the agent to write persistent artifacts under ~/.opencli/sites/, including endpoints, field maps, notes, verify files, and fixtures, but does not require user confirmation or clearly warn that local state will be modified. In an agentic setting, silent persistence can surprise users, pollute long-lived state, and create integrity/privacy issues if later runs trust stale or unintended data.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The guidance explicitly tells implementers to hardcode a fallback list for English and Simplified Chinese labels. This is a natural-language locale policy constraint that privileges specific languages without indicating user choice or a region-specific justification.

Content

No source excerpt is available for this finding.