Back to skill

Security audit

Agent Browser

Security checks for vulnerabilities and agentic risk

Overview

The skill is a transparent browser-automation helper, but it needs Review because it encourages saving and replaying login sessions and recording authenticated flows without enough safeguards for sensitive session files and credentials.

Install only if you are comfortable giving the agent broad browser-control abilities. Treat saved browser state, recordings, screenshots, PDFs, cookies, proxy URLs, and captured page text as sensitive data; use test or low-privilege accounts, avoid recording real logins, store auth-state files outside shared directories with strict permissions, exclude them from version control, and delete or revoke them when no longer needed.

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
references/session-management.md:63
Finding

Authentication state is stored in predictable files without enforced access controls

Content
View full analysis

Vulnerability Details

File Location: references/session-management.md:63-87; related examples appear in references/authentication.md:28-42, references/authentication.md:60-82, references/authentication.md:85-102, templates/authenticated-session.sh:14-20, and templates/authenticated-session.sh:88-89
Vulnerability Type: Insecure storage of reusable authentication state and unsafe temporary-file usage
Risk Level: Medium

Vulnerable Code

bash
### Authenticated Session Reuse

```bash
#!/bin/bash
# Save login state once, reuse many times

STATE_FILE="/tmp/auth-state.json"

# Check if we have saved state
if [[ -f "$STATE_FILE" ]]; then
    agent-browser state load "$STATE_FILE"
    agent-browser open https://app.example.com/dashboard
else
    # Perform login
    agent-browser open https://app.example.com/login
    agent-browser snapshot -i
    agent-browser fill @e1 "$USERNAME"
    agent-browser fill @e2 "$PASSWORD"
    agent-browser click @e3
    agent-browser wait --load networkidle

    # Save for future use
    agent-browser state save "$STATE_FILE"
fi
text

The authenticated-session template similarly defaults to a relative, persistent file:

```bash
LOGIN_URL="${1:?Usage: $0 <login-url> [state-file]}"
STATE_FILE="${2:-./auth-state.json}"

if [[ -f "$STATE_FILE" ]]; then
    echo "Loading saved authentication state..."
    agent-browser state load "$STATE_FILE"
    agent-browser open "$LOGIN_URL"
    agent-browser wait --load networkidle
fi

# Save state for future runs
# agent-browser state save "$STATE_FILE"

Technical Analysis

Browser state files contain security-sensitive cookies and browser storage that may include reusable session tokens. The documented workflow writes that state to the fixed path /tmp/auth-state.json, while the template recommends ./auth-state.json or an arbitrary caller-supplied path.

The examples ...[truncated 2509 chars]

Remediation
View remediation

Remediation Suggestions

  1. Store state under a user-private runtime or configuration directory rather than a fixed shared /tmp path:

    bash
    umask 077
    STATE_DIR="${XDG_RUNTIME_DIR:-$HOME/.local/state}/agent-browser"
    mkdir -p -- "$STATE_DIR"
    chmod 700 -- "$STATE_DIR"
    STATE_FILE="$STATE_DIR/auth-state.json"
    
  2. If state is needed only for the current workflow, generate an unpredictable path and remove it on exit:

    bash
    umask 077
    STATE_DIR="$(mktemp -d)"
    STATE_FILE="$STATE_DIR/auth-state.json"
    
    cleanup() {
        rm -f -- "$STATE_FILE"
        rmdir -- "$STATE_DIR" 2>/dev/null || true
    }
    trap cleanup EXIT
    
  3. After saving persistent state, explicitly restrict access:

    bash
    agent-browser state save "$STATE_FILE"
    chmod 600 -- "$STATE_FILE"
    
  4. Before loading an existing state file, verify that it is a regular, non-symbolic-link file owned by the current user. Reject unexpected ownership, permissions, and paths.

  5. Avoid sharing one fixed state filename between users, jobs, or application environments. Use per-user and per-application directories and filenames.

  6. Add state files to version-control ignore rules, encrypt persistent state at rest where feasible, and establish a short retention period.

  7. Revoke affected sessions and delete saved state securely after suspected disclosure. CI workflows should avoid persisting authentication state unless strictly necessary.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (16)

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

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

Delete after use

rm /tmp/auth-state.json

text

### 4. Timeout Long Sessions

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The login recording example explicitly shows entering an email and password while video capture is active, but it omits any caution that the resulting recording may preserve credentials, MFA prompts, account identifiers, or other authentication artifacts. Because this skill is specifically for browser automation and documentation/CI use, operators may copy this pattern into real environments, causing credential exposure through stored videos and build artifacts.

Content

No source excerpt is available for this finding.

Context Window Stuffing

Medium
Category
Memory Poisoning
Confidence
85% confidence
Finding

Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.

Content

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

agent-browser open # Navigate to page agent-browser snapshot -i # Get interactive elements with refs agent-browser click @e1 # Click element by ref agent-browser fill @e2 "text" # Fill input by ref agent-browser close # Close browser

text

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documentation states that recording preserves cookies and storage from the active session, which can cause authenticated state, tokens, or other sensitive data to be captured or replayed without the user appreciating the risk. In a browser automation skill, this increases the chance of leaking privileged session context into saved artifacts or subsequent workflows.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The example encourages saving and later loading auth.json without warning that persisted browser state may contain session cookies, bearer tokens, or other secrets that grant account access. If stored insecurely, shared, or committed to source control, this file can enable account takeover or unauthorized reuse of authenticated sessions.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
93% confidence
Finding

Loading previously saved browser state enables session persistence across runs, which is inherently risky when the state contains active authentication material. In this skill's context, that behavior is useful but dangerous because it can silently reuse privileged sessions, especially on shared systems or in automated pipelines.

Content

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

agent-browser wait --url "**/dashboard" agent-browser state save auth.json

Later sessions: load saved state

agent-browser state load auth.json agent-browser open https://app.example.com/dashboard

text

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The example instructs users to save authenticated browser state to a reusable file immediately after login, but it does not warn at the point of creation that the file may contain live session cookies or tokens. In a browser automation skill, such files can be copied, reused, or accidentally committed, enabling session hijacking if mishandled.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The OAuth example saves browser state after a third-party login flow without an immediate warning that the saved file may contain active OAuth session cookies or tokens tied to a Google or similar identity provider. Because these tokens can grant access across federated services, mishandling the file can have broader consequences than a normal local app session.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The 2FA flow saves browser state after successful second-factor completion, effectively preserving a fully authenticated session that bypasses repeating 2FA until expiry. If the file is leaked or reused by another party, it can undermine the protection expected from multi-factor authentication.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documentation recommends embedding proxy credentials directly in environment-variable URLs without warning about the security consequences. Proxy operators can observe proxied traffic and the credentials may be exposed through shell history, logs, process listings, environment inspection, or CI output, which increases the risk of credential leakage and unintended disclosure of sensitive browsing data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The proxy-rotation scraping example frames proxies as a way to avoid rate limiting but omits the privacy, legal, and policy risks of routing browsing and extracted data through third-party infrastructure. In the context of a browser automation skill, this can encourage users to evade service controls and expose session data, targets, and collected content to untrusted proxy providers.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
55% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · references/session-management.md (reported line 43)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
95% confidence
Finding

The documentation encourages recording and saving full browser sessions but does not warn that videos can capture sensitive on-screen content such as credentials, personal data, session state, or internal application details. In a browser-automation skill, users are likely to run flows against real applications, so saved recordings can become sensitive artifacts that are later shared, stored insecurely, or retained in CI systems.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This markdown file demonstrates filling an email and password field and submitting a login form, which involves sensitive user data. The surrounding skill description does not provide any warning about credential handling, privacy considerations, or verifying the target site before submission.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

This shell script performs a file deletion with rm -f "$STATE_FILE". Although there is a preceding message that the session expired, the script does not explicitly disclose that it will remove the saved state file, so the destructive action is not clearly communicated at the point of execution.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.