Back to skill

Security audit

Chatgpt Search

Security checks for vulnerabilities and agentic risk

Overview

This skill mostly does what it says, but it also saves ChatGPT session screenshots locally without clear user notice or an opt-out.

Review before installing. Avoid using this skill with secrets, personal data, proprietary code, or account-sensitive ChatGPT sessions unless screenshots are removed or made explicit opt-in with private storage and cleanup. Also be aware that the CLI wrapper may not perform the advertised search automatically.

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
scripts/chatgpt-handler.js:162
Finding

Unconditional Plaintext Retention of Potentially Sensitive ChatGPT Conversations

Content
View full analysis

Vulnerability Details

File Location: scripts/chatgpt-handler.js, lines 20 and 101–187
Vulnerability Type: Unprotected sensitive-data storage and unsafe temporary-file handling
Risk Level: Medium

Vulnerable Code

javascript
const CONFIG = {
    chatgptUrl: 'https://chatgpt.com',
    timeout: 30000,
    waitAfterType: 500,
    waitAfterSubmit: 10000,
    screenshotDir: '/tmp/chatgpt-screenshots'
};
javascript
// 10. 保存截图(可选)
await saveScreenshot(browser, targetId, query);
javascript
async function saveScreenshot(browser, targetId, query) {
    try {
        // 创建截图目录
        if (!fs.existsSync(CONFIG.screenshotDir)) {
            fs.mkdirSync(CONFIG.screenshotDir, { recursive: true });
        }
        
        // 生成文件名
        const filename = `chatgpt-${Date.now()}-${hashQuery(query)}.png`;
        const filepath = path.join(CONFIG.screenshotDir, filename);
        
        // 截图
        await browser.screenshot({
            targetId: targetId,
            path: filepath,
            fullPage: false
        });
        
        console.log(`📷 截图已保存:${filepath}`);
        return filepath;
    } catch (error) {
        console.error(`截图失败:${error.message}`);
        return null;
    }
}

Technical Analysis

Every successful search unconditionally calls saveScreenshot, despite the comment describing the operation as optional. The screenshot captures the visible ChatGPT page, which can contain the submitted query, contextual information, and the generated response.

The resulting PNG is stored persistently in the shared /tmp/chatgpt-screenshots directory. The implementation does not explicitly apply restrictive directory or file permissions, obtain user consent, provide an opt-out, encrypt the content, or remove old screenshots. The query-derived hash in the filename does not protect the screenshot contents and is not a cryptographic access-control mechanism.

This creates a local data-retention weakness when ...[truncated 1354 chars]

Remediation
View remediation

Remediation Suggestions

  1. Disable screenshots by default and require an explicit configuration option or per-request user consent to enable them.
  2. Avoid taking screenshots when prompts or responses may contain credentials, tokens, personal information, proprietary code, or other secrets.
  3. Store screenshots in a per-user private directory rather than a shared temporary path.
  4. Create the storage directory with mode 0700 and ensure screenshot files are created with mode 0600, while accounting for the browser API’s file-creation behavior.
  5. Use securely generated, non-predictable filenames instead of timestamp-and-hash identifiers.
  6. Implement automatic deletion immediately after the screenshot’s intended use, or enforce a documented short retention period with reliable cleanup.
  7. Return the screenshot path only when necessary and avoid logging sensitive paths in multi-user environments.
  8. Add a startup or shutdown cleanup routine for stale screenshots, with safeguards against symbolic-link and path-manipulation attacks.
  9. Update the documentation to accurately state when screenshots are captured, where they are retained, and how users can disable or delete them.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (21)

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

The skill metadata and documentation claim a simple ChatGPT search capability, but the static finding indicates additional undeclared behaviors such as local filesystem writes and screenshot persistence. Undisclosed data capture and storage are security-relevant because they may retain sensitive prompts, responses, cookies, or page content in /tmp without user awareness, expanding the attack surface beyond the stated purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill metadata and documentation claim a simple ChatGPT search capability, but the static finding indicates additional undeclared behaviors such as local filesystem writes and screenshot persistence. Undisclosed data capture and storage are security-relevant because they may retain sensitive prompts, responses, cookies, or page content in /tmp without user awareness, expanding the attack surface beyond the stated purpose.

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 41)May include surrounding context.

md
node scripts/chatgpt-search.js "你的问题"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/chatgpt-search.js "你的问题"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/chatgpt-search.js "你的问题"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/chatgpt-search.js "你的问题"

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/chatgpt-search.js "你的问题"

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documented trigger phrases are broad enough to overlap with normal user conversation, which can cause the skill to activate unintentionally. In an agent environment, accidental invocation can route arbitrary user queries to browser automation and a third-party service without clear user intent, creating privacy and behavior-integrity risks.

Content

No source excerpt is available for this finding.

File System Enumeration

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.

Content

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

  1. 检查 Skill 文件:
bash
ls -la ~/.openclaw/workspace/skills/chatgpt-search/
  1. 测试脚本:

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

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

ls ~/.openclaw/workspace/skills/

查看 SKILL.md 格式

cat ~/.openclaw/workspace/skills/chatgpt-search/SKILL.md

text

### 浏览器不可用

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown file contains user-facing natural-language instructions exclusively in Chinese, including the description, examples, warnings, and troubleshooting sections. Under the policy, forcing a specific language without user opt-in or a documented regional justification is a language/locale 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

The file’s user-facing comments and CLI usage/help text are written in Chinese, and there is no indication that the skill supports other languages or lets the user opt into a locale. Under the language/locale policy, forcing a specific language without user choice or clear region-specific justification is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The core function sends the user’s query to chatgpt.com, which is an external service, but the skill provides no explicit privacy disclosure at the point of use. In an automation skill, this matters because users may assume processing is local or may unknowingly submit secrets, credentials, or proprietary data to a third party.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill’s stated purpose is to submit a query to ChatGPT and return the answer, but it also captures and stores screenshots of the session locally. Those screenshots can contain the user’s prompt, the model response, and surrounding page data, creating unnecessary retention of potentially sensitive information beyond the declared function.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill saves a screenshot of the ChatGPT interaction to disk without explicit notice or consent. Because screenshots can capture sensitive queries, answers, or account/session context, this creates a privacy risk through unannounced local data retention.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code creates directories and writes screenshot files to the local filesystem even though local persistence is not required to obtain ChatGPT answers. This expands the skill’s data-handling surface and can leak sensitive prompts or responses to other local users, backup systems, or later processes that access /tmp.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file's docstring, usage instructions, and later console messages are written only in Chinese, which imposes a specific language on users. The policy allows locale constraints only when justified or when users are given a choice, neither of which appears here.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest says the skill uses browser automation on ChatGPT to search questions and obtain AI answers without login. In code, the script does not automate a browser session or retrieve any real response; it emits instructions for a human/OpenClaw to execute and sets answer to a fixed placeholder string.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The README presents instructions, trigger phrases, and usage entirely in Chinese, with no indication that other languages are supported or that this locale restriction is intentional. Under the stated policy, forcing a specific language without user opt-in can be a natural-language policy issue.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The usage examples are ambiguous about the exact invocation semantics, making it unclear which phrases actually activate the skill. That ambiguity increases the chance of accidental triggering or inconsistent behavior, especially when combined with globally loaded skills.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The comments say the script is 'using OpenClaw browser tool for search' and 'executing browser operations,' which implies real automated interaction. However, the following code only prints steps to stdout and never invokes any browser API, so the documentation overstates what the code does.

Content

No source excerpt is available for this finding.