Back to skill

Security audit

osm-ai-bridge

Security checks for vulnerabilities and agentic risk

Overview

This skill is an AI browser bridge, but it requests broad live-browser access, storage access, anti-detection behavior, and persistent logging without enough scoping or user safeguards.

Review this carefully before installing. Use it only with an isolated browser profile and non-sensitive prompts, avoid attaching it to your normal logged-in browser, and be aware that the documented design can read browser session storage, alter automation fingerprints, send content to third-party AI services, and keep prompt fragments in local logs.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/osm_ai_bridge.py:143
Finding

Overprivileged Access to Existing Browser Sessions and Sensitive Storage

Content
View full analysis

Vulnerability Details

File Location: scripts/osm_ai_bridge.py, lines 143–181
Vulnerability Type: Unrestricted browser-context attachment and sensitive session storage access
Risk Level: High

Vulnerable Code

python
async def _access_storage(self):
    """Access cookies and LocalStorage."""
    if not self.page:
        return {}

    try:
        cookies = await self.context.cookies()

        local_storage = await self.page.evaluate('() => {
            const items = {};
            for (let i = 0; i < localStorage.length; i++) {
                const key = localStorage.key(i);
                items[key] = localStorage.getItem(key);
            }
            return items;
        }')

        logger.info(f"Accessed {len(cookies)} cookies and {len(local_storage)} LocalStorage entries")

        return {
            'cookies': cookies,
            'localStorage': local_storage
        }
    except Exception as e:
        logger.warning(f"Storage access failed: {e}")
        return {}

async def start(self):
    from playwright.async_api import async_playwright

    self.playwright = await async_playwright().start()

    if not await self._check_cdp_available():
        await self._start_browser_with_debugging()

    self.browser = await self.playwright.chromium.connect_over_cdp(self.CDP_URL)

    contexts = self.browser.contexts
    if contexts:
        self.context = contexts[0]
    else:
        self.context = await self.browser.new_context()

    await self._inject_anti_detection()

    pages = self.context.pages
    if pages:
        self.page = pages[0]
    else:
        self.page = await self.context.new_page()

    await self._access_storage()

The displayed comments and log messages are English translations of the original source text; executable statements and control flow are unchanged.

Technical Analysis

The bridge con ...[truncated 2737 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove _access_storage() unless a narrowly defined feature genuinely requires specific storage values.
  2. Do not call context.cookies() across an existing user context. If a cookie is required, restrict retrieval to an explicit, validated target URL.
  3. Launch and use a dedicated browser profile owned by the Skill instead of attaching to the user's general-purpose browser profile.
  4. Create or locate a dedicated page by an exact allowlisted origin rather than selecting pages[0].
  5. Validate self.page.url before reading storage or interacting with the DOM. Permit only expected HTTPS origins such as the explicitly supported AI service.
  6. Reject unexpected CDP endpoints and avoid exposing CDP on non-loopback interfaces.
  7. Prefer a private Playwright-managed browser connection or pipe-based transport over a generally accessible debugging port.
  8. Apply the same context and page-origin protections to scripts/osm_ai_discuss.py.
  9. If storage access must remain, keep values in memory for the shortest possible period, never log them, and document the exact data and purpose.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/osm_ai_bridge.py:13
Finding

User Prompt Fragments Are Persisted in a Plaintext Log

Content
View full analysis

Vulnerability Details

File Location: scripts/osm_ai_bridge.py, lines 13–23 and line 190
Vulnerability Type: Plaintext storage of potentially sensitive user input
Risk Level: Medium

Vulnerable Code

python
CONFIG_DIR = Path.home() / ".openclaw" / "ai_bridge"
CONFIG_DIR.mkdir(parents=True, exist_ok=True)

logging.basicConfig(
    level=logging.INFO,
    format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
    handlers=[
        logging.FileHandler(CONFIG_DIR / 'ai_bridge.log', encoding='utf-8'),
        logging.StreamHandler()
    ]
)
logger = logging.getLogger('osm_ai_bridge')
python
logger.info(f"Starting Ask workflow - AI: {self.ai_name}, question: {question[:50]}...")

The second statement is an English translation of the original log message; the interpolation of self.ai_name and question[:50] is unchanged.

Technical Analysis

The application configures a persistent file handler at ~/.openclaw/ai_bridge/ai_bridge.log. During each Ask operation, it writes the first 50 characters of the user's question into that file.

User prompts can contain passwords, API keys, personal information, confidential business data, internal code, or other sensitive material. Truncating the prompt to 50 characters does not provide meaningful protection because credentials and identifying details often fit entirely within that range.

The code does not implement redaction, restrictive file permissions, encryption, rotation, retention limits, or an opt-in mechanism for content logging. The configuration directory is created using platform defaults, so confidentiality depends on the user's operating system and environment.

Attack Path

  1. A user submits a prompt containing sensitive information.
  2. The Ask workflow interpolates the first 50 characters into an INFO-level log message.
  3. logging.FileHandler writes the message to `~/.openclaw/ai_bridge/ai_bridge.log ...[truncated 959 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove prompt content from log messages. Log only non-sensitive metadata, such as a generated request identifier and completion status.
  2. If diagnostic content logging is necessary, require explicit user opt-in and prominently warn that prompts may contain sensitive information.
  3. Implement structured redaction for credentials, authorization headers, tokens, email addresses, and other sensitive patterns.
  4. Create the configuration directory and log file with owner-only permissions where supported.
  5. Add size-based or time-based log rotation and a short retention period.
  6. Provide a configuration option to disable file logging entirely.
  7. Avoid placing plaintext logs in backups or support bundles unless users explicitly approve their inclusion.

T08 · Insecure Dependencies

Warning
Location
SKILL.md:64
Finding

Unpinned Runtime Dependencies Create Supply-Chain Exposure

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 64–66
Vulnerability Type: Mutable and unverifiable third-party dependency installation
Risk Level: Medium

Vulnerable Code

bash
pip install playwright aiohttp

Technical Analysis

The installation instructions direct users to install playwright and aiohttp without version constraints, cryptographic hashes, a lockfile, or a documented trusted package index.

As a result, installation is not reproducible. The effective code installed and later imported by the Skill can change over time without any modification to the audited repository. A compromised package release, malicious dependency update, or incompatible future release could execute code with the privileges of the user running the Skill.

The package names shown are established packages and no typosquatted dependency was identified. The risk arises from accepting mutable latest releases without integrity verification rather than from evidence that the named packages are currently malicious.

Attack Path

  1. A user follows the documented installation command.
  2. pip resolves the latest package versions and their transitive dependencies from its configured package index.
  3. No lockfile or hash is available to verify that the resolved artifacts match versions reviewed by the project.
  4. A compromised, unexpectedly changed, or malicious package release is downloaded.
  5. Package installation hooks or imported dependency code executes under the user's account.
  6. The dependency gains the same filesystem, network, browser-session, and process privileges available to the Skill.

Impact Assessment

A malicious dependency executing in this environment could potentially:

  • Read or modify files accessible to the invoking user.
  • Access the browser debugging endpoint and authenticated browser context.
  • Read the Skill's configuration and logs.
  • Send data over the network.

...[truncated 270 chars]

Remediation
View remediation

Remediation Suggestions

  1. Add a reviewed dependency file with exact versions, such as:
    text
    playwright==<reviewed-version>
    aiohttp==<reviewed-version>
    
  2. Generate and publish a lockfile that includes all transitive dependencies.
  3. Require cryptographic hashes during installation, for example through a hash-locked requirements file and pip install --require-hashes.
  4. Document the expected trusted package index and prohibit untrusted extra indexes.
  5. Install dependencies in an isolated virtual environment with minimal privileges.
  6. Regularly scan dependencies for known vulnerabilities and review updates before changing pinned versions.
  7. Document the Playwright browser binary version and installation process so that browser artifacts are also reproducible.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (20)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The code substantially matches several declared capabilities: it connects over CDP, can auto-start a browser, injects anti-detection scripts, and accesses cookies/localStorage. However, the declared description specifically promises three collaboration modes (Ask/Discuss/Verify) and a multi-AI coordination bridge, while the supplied code only implements a single ask() workflow for one selected AI endpoint at a time. There is no implementation of Discuss or Verify orchestration logic. Additionally, the code includes an interactive manual-login prompt, which is not reflected in the description. Therefore the description overstates the implemented primary behavior enough to count as a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The description presents a broader browser bridge with multiple capabilities and three collaboration modes. This code chunk only covers one concrete discussion script. It does use CDP to connect to a browser, which partially matches the description, but the other prominently declared capabilities—automatic startup, anti-detection injection, Cookie/LocalStorage access, and Ask/Verify modes—are absent from this code. The actual primary behavior is a narrow prompt-send / response-scrape automation against an existing browser tab, so the description materially overstates what this specific code chunk does.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The code injects an anti-detection script that hides webdriver presence, spoofs plugins, overrides permissions behavior, and falsifies WebGL and Chrome properties. Those actions are not necessary to simply connect to a browser and submit prompts to an AI site; they are classic evasion techniques that help automated activity avoid bot detection and platform safeguards.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill enumerates cookies and LocalStorage from the active browser context and logs the counts after collecting them, despite that data being unrelated to the stated function of asking an AI a question. This exposes authenticated session material and potentially account tokens, creating a direct path to session theft, privacy loss, or lateral access to unrelated sites in the same browser context.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

Sensitive browser storage is accessed automatically with no user-facing warning, consent, or feature justification. In the context of a browser bridge for AI chat, silent collection of cookies and LocalStorage materially increases the risk of unauthorized access to authenticated accounts and private data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The changelog explicitly promotes connecting to a user's existing browser session via CDP and reusing already authenticated AI accounts, but does not warn that this grants the skill access to the user's active web session and potentially sensitive page data. In the context of a browser-automation bridge with Cookie/LocalStorage access, this omission materially increases the risk of credential misuse, unintended account actions, and privacy exposure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file documents anti-detection script injection and direct page-content extraction without any caution about stealth automation, full DOM access, or the ability to read and manipulate sensitive browser state. In this skill's context, those features are especially dangerous because they indicate deliberate evasion behavior combined with broad access to user data in a logged-in browser session.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill advertises capabilities that imply browser control, remote debugging, and data access, but it does not declare any explicit tool scope or permissions. In practice this obscures that the skill may need shell and network access, reducing reviewability and increasing the chance that an agent executes it with broader privileges than a user expects.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill explicitly mentions Cookie and LocalStorage access but does not provide a clear warning that these stores can contain session tokens, authentication state, and personal data. In the context of a browser-bridging skill, this omission is dangerous because users may authorize or run it without understanding that it can expose highly sensitive live-session material.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Automatically launching a browser with remote debugging enabled materially changes the attack surface of the host because CDP can permit deep browser inspection and control. Without a prominent warning, users may not realize they are enabling a powerful local control channel that can expose pages, cookies, and session context to other local or reachable processes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documentation states that anti-detection scripts are injected to hide webdriver characteristics, but it does not clearly warn users that this alters the browser environment to evade detection. This is risky because it can facilitate deceptive automation against third-party services and increases legal, compliance, and account-security exposure.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file contains user-facing natural-language text and defaults such as Chinese-only descriptions and the fallback prompt "你好", indicating a fixed language choice. There is no indication that the user can choose their preferred language or locale before interaction.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The comment claims the launched profile will not interfere with the user's main browser, but the actual logic first connects to any browser already exposing CDP on localhost:9222 and then uses its existing context. This mismatch is dangerous because it misrepresents isolation guarantees and may cause operators to trust the tool with access it does not actually constrain.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The bridge attaches to an existing CDP browser and reuses the first existing context and page when available, rather than operating solely in a dedicated isolated session. That design can expose unrelated tabs, logged-in sessions, cookies, page content, and storage from a user's active browser to the skill.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill logs the user's question text to a file on disk without disclosure or opt-in. Prompts often contain sensitive business data, credentials, personal information, or proprietary content, so persistent logging creates avoidable confidentiality and retention risks.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script takes user-supplied discussion content and automatically submits it through an already-authenticated browser session to an external AI service over CDP, without any consent gate, data classification check, or warning about third-party disclosure. In this skill’s broader context, the bridge is explicitly designed to access browser state and automate external AI interactions, which increases the risk that sensitive local ideas, business data, or other pasted content are unintentionally exfiltrated to the external provider.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The changelog describes Doubao as '中文优化' and repeatedly highlights '中文优化' and Chinese encoding support as a built-in behavior. As written, the natural-language description emphasizes a specific language/locale orientation without stating that users can choose another language or opt in to this preference.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill description and user-facing documentation are presented in Chinese, with no indication that other languages are supported or that Chinese is a required locale for a justified regional use case. This may violate a language/locale policy if users are not given a choice or informed of the constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The natural-language prompt instructs the external model to analyze the topic specifically from '中文互联网市场' perspective. This forces a locale-specific framing without offering the user a choice or documenting why that locale is required.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The page scraping logic reads broad page text from document.body.innerText and prints the filtered tail of it, which can capture not only the AI response but also surrounding page content from the active browser tab. Because this skill attaches to an existing browser context, it may expose unrelated on-page data, user content, or session-derived information to stdout/logs, making the issue more dangerous than a simple response parser.

Content

No source excerpt is available for this finding.