Back to skill

Security audit

Agent Browser

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent browser automation skill, but it grants broad website, credential, session, proxy, and persistence powers with some under-scoped safety guidance, so it should be reviewed before use.

Install only if you need powerful browser automation and are prepared to supervise it. Use domain allowlists and action policies before logging in or submitting forms, prefer the encrypted auth vault over saved browser state, treat state files, cookies, recordings, traces, and proxy credentials like passwords, and avoid using the proxy guidance to bypass rate limits or bans.

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
templates/authenticated-session.sh:27
Finding

Authentication State Is Stored Without Enforced File Protection and Is Not Covered by the Recommended Ignore Pattern

Content
View full analysis

Vulnerability Details

File Location: templates/authenticated-session.sh:27, 98-99
Related Locations: references/authentication.md:51, 179-181; references/session-management.md:41-50, 181-185
Vulnerability Type: Plaintext sensitive state storage and incomplete repository exclusion
Risk Level: Medium

Vulnerable Code

From templates/authenticated-session.sh:

bash
STATE_FILE="${2:-./auth-state.json}"
bash
# Save state for future runs
# echo "Saving state to $STATE_FILE"
# agent-browser state save "$STATE_FILE"

From references/authentication.md:

bash
# Save authenticated state
agent-browser state save ./auth-state.json
bash
1. **Never commit state files** - They contain session tokens
   ```bash
   echo "*.auth-state.json" >> .gitignore
text

From `references/session-management.md`:

```bash
### State File Contents

```json
{
  "cookies": [...],
  "localStorage": {...},
  "sessionStorage": {...},
  "origins": [...]
}
text

```bash
# Don't commit state files (contain auth tokens!)
echo "*.auth-state.json" >> .gitignore

# Delete after use
rm /tmp/auth-state.json

Technical Analysis

The authenticated-session template defaults to writing reusable browser state to ./auth-state.json. The project documentation confirms that state files contain cookies and browser storage and may therefore contain bearer session tokens, refresh tokens, and other authentication material.

The workflow does not set a restrictive process umask, create a private storage directory, or enforce mode 0600 on the resulting file. Its effective permissions consequently depend on the caller's environment and the behavior of agent-browser.

The recommended Git exclusion rule is also incomplete. The pattern *.auth-state.json does not match the default filename auth-state.json. It also does not cover other documented names such as oauth-state.json and 2fa-state.json. A user who follows the documented guidance ...[truncated 1696 chars]

Remediation
View remediation

Remediation Suggestions

  1. Prefer the encrypted authentication vault already recommended by the project instead of exporting reusable browser state to project files.
  2. If state files are required, create them in a dedicated private directory and enforce restrictive permissions:
bash
umask 077
STATE_DIR="${XDG_STATE_HOME:-$HOME/.local/state}/agent-browser"
mkdir -p "$STATE_DIR"
chmod 700 "$STATE_DIR"
STATE_FILE="${2:-$STATE_DIR/auth-state.json}"

agent-browser state save "$STATE_FILE"
chmod 600 "$STATE_FILE"
  1. Refuse to load state files that are accessible to group or other users, where supported by the operating system.
  2. Replace the incomplete ignore guidance with patterns covering every documented state filename, for example:
gitignore
auth-state.json
oauth-state.json
2fa-state.json
*.auth-state.json
*-state.json
  1. Add an appropriate project-level .gitignore rather than relying only on users to append patterns manually.
  2. Avoid publishing state files as CI artifacts or retaining them in shared workspaces and backups. Delete them immediately after use when persistence is unnecessary.
  3. Use short-lived sessions, server-side revocation, token rotation, device binding, and mandatory reauthentication for sensitive actions to limit the effect of state-file disclosure.
  4. Document that state files must be treated as credentials and must never be logged, committed, attached to reports, or shared.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
Findings (27)

Context Leakage

High
Category
Data Exfiltration
Confidence
89% confidence
Finding

Session recording and profiling can capture sensitive page contents, credentials, tokens, personal data, and authenticated workflows into local artifacts such as videos and trace files. In a browser automation skill, these outputs may persist beyond the session and be easier to exfiltrate or mishandle than live transient data.

Content

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

bash
agent-browser --headed open https://example.com
agent-browser highlight @e1          # Highlight element
agent-browser record start demo.webm # Record session
agent-browser profiler start         # Start Chrome DevTools profiling
agent-browser profiler stop trace.json # Stop and save profile (path optional)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/authentication.md (reported line 193)May include surrounding context.

  1. Clean up after automation

    bash
    agent-browser cookies clear
    rm -f ./auth-state.json
    
  2. Use short-lived sessions for CI/CD

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
85% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/session-management.md (reported line 185)May include surrounding context.

echo "*.auth-state.json" >> .gitignore

Delete after use

rm /tmp/auth-state.json

text

### 4. Timeout Long Sessions

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

Referencing npx agent-browser without a pinned version in the skill manifest permits execution of whatever version npm resolves at invocation time. Because this skill exposes powerful browser automation capabilities, a compromised or breaking upstream release could lead to unsafe actions or data exposure.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The trigger text is extremely broad and covers many generic website-related requests, increasing the chance the skill is invoked in situations where browser automation is unnecessary or unsafe. Since the skill can perform impactful actions like clicking, logging in, downloading, and submitting forms, over-broad routing raises the risk of unintended use on sensitive sites or with user data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The description explicitly enables login, form filling, clicking, and other account-impacting browser actions without an upfront warning about privacy, credential handling, consent, or side effects. In practice, this can normalize risky automation and cause agents to act on authenticated sessions or submit data without clear user acknowledgment.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

The manifest allows execution via npx agent-browser without pinning an exact package version, which means a future upstream package change or supply-chain compromise could alter behavior at runtime. In an agent skill that can navigate, log in, download files, and execute browser-side JavaScript, unpinned resolution materially increases risk.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
86% confidence
Finding

Persisting browser configuration and profile data in the project root can lead to session artifacts, cookies, local storage, proxy settings, or other sensitive state being retained on disk and potentially committed, shared, or reused unintentionally. This skill already supports session persistence and saved state, so additional persistent local configuration increases the chance of credential and context leakage across runs.

Content

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

Configuration File

Create agent-browser.json in the project root for persistent settings:

json
{

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The example instructs users to save authenticated browser state to disk immediately after login without an inline warning that the file may contain reusable session cookies and tokens equivalent to credentials. In a browser automation skill, such state files are especially sensitive because agents may persist, copy, or reuse them across tasks, increasing the chance of accidental disclosure or account takeover.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The OAuth/SSO flow saves authenticated state after logging into a third-party identity provider, but does not warn that the saved file may include first-party and third-party session cookies or federated login artifacts. That can enable unauthorized reuse of SSO sessions, which is more dangerous than ordinary app-only state because it may broaden access across integrated services.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The HTTP Basic Auth example uses literal username password values without warning that these credentials will be attached to subsequent requests and should not be hardcoded. In practice, readers may copy this pattern into scripts, leading to plaintext secrets in shell history, repos, or logs.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The cookie-setting example shows manual injection of an authentication cookie without warning that the cookie value is effectively a bearer token granting account access. In an agent-driven browser context, this is particularly risky because copied examples may encourage token handling in plaintext and session hijacking if exposed.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The documented set credentials user pass command encourages passing secrets directly on the command line, which can leak via shell history, audit logs, CI logs, or process listings visible to other local users. This creates a realistic credential exposure path even if the underlying feature is intended for legitimate HTTP authentication.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Commands to read, set, and clear cookies and localStorage provide direct access to session identifiers, CSRF tokens, and other sensitive browser-resident data, yet the documentation gives no warning about the sensitivity of these values. In an agent-controlled browser context, such commands materially increase the risk of credential theft, unauthorized session reuse, and accidental disclosure in logs or outputs.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Request inspection can capture Authorization headers, cookies, API keys, and request bodies containing personal or confidential data, but the documentation does not warn users about this risk. In a browser automation tool, agents may inspect authenticated traffic at scale, making silent collection and leakage of sensitive network data more likely.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documentation explicitly exposes a command to save cookies, storage, and authentication state to a file, but provides no warning that the resulting artifact may contain bearer tokens, session cookies, or other secrets that enable account takeover if copied or reused. In a browser-automation skill, this is particularly dangerous because the feature directly facilitates persistence and exfiltration of live authenticated sessions.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
90% confidence
Finding

State restoration enables replay of a previously captured authenticated browser context, which can be abused to bypass re-authentication and reuse another user's session if state files are accessible. The capability is legitimate for test automation, but in this skill context it increases the operational risk because session cloning is a core browser-automation function.

Content

Scanner excerpt · references/commands.md (reported line 214)May include surrounding context.

bash
agent-browser state save auth.json    # Save cookies, storage, auth state
agent-browser state load auth.json    # Restore saved state

Global Options

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The profiling documentation instructs users to capture and save Chrome trace files but does not warn that those files can include sensitive browsing metadata, page URLs, timing of user actions, and potentially page-derived data exposed through trace events. In a browser automation skill, this omission is more dangerous because traces are likely to be collected during authenticated sessions, test runs, or interactions with internal web apps, increasing the chance of accidental retention or sharing of sensitive information.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The documentation explicitly frames proxy support as useful for rate limiting avoidance, which encourages evasion of a target site's access controls rather than legitimate browser automation alone. In an agent browser skill, this increases the chance that users or downstream agents employ the tool for abusive scraping or policy circumvention.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Embedding proxy usernames and passwords directly in URLs and environment variables can expose secrets through shell history, process listings, logs, crash reports, and CI output. The example normalizes an insecure credential-handling pattern without warning, making accidental disclosure more likely.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The SOCKS proxy example similarly places credentials in an environment variable, which may be visible to other local users, debugging tools, or automation logs. In documentation for an agent-oriented CLI, this can propagate insecure copy-paste behavior across local and CI environments.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The rotating-proxies example provides actionable instructions for cycling proxies specifically to avoid rate limiting during scraping, which operationalizes evasion of anti-abuse controls. Because this skill enables automated web interaction, such guidance materially lowers the barrier to misuse for unauthorized or excessive scraping.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation demonstrates saving and reusing authenticated browser state, which typically includes cookies and session tokens, but the example does not present an immediate warning about the sensitivity of that data at the point of use. In the context of a browser automation skill, this can normalize insecure handling of reusable authentication artifacts and lead users to store them in unsafe locations or share them inadvertently.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
86% confidence
Finding

Loading previously saved session state restores authentication context without re-authentication, which makes the state file a high-value artifact equivalent to an active login session. In a browser automation tool, this increases risk because compromise or misuse of the file can grant immediate access to protected resources.

Content

Scanner excerpt · references/session-management.md (reported line 55)May include surrounding context.

Load Session State

bash
# Restore saved state
agent-browser state load /path/to/auth-state.json

# Continue with authenticated session

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The authenticated session reuse example writes auth state to /tmp/auth-state.json and uses live credentials to establish that state, but it does not clearly warn that both the credentials and the resulting session file are highly sensitive. On many systems, /tmp is a shared location and temporary files are more likely to be exposed, copied, or left behind, enabling session hijacking or unauthorized account access.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.