T09 · Insecure Skill Coding Practices
- Location
src/browser.py:44- Finding
Unrestricted URL Navigation Enables Server-Side Request Forgery and Local Network Access
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This appears to be a real browser automation skill, but it needs Review because it can run page scripts, browse arbitrary URLs, upload files, and capture page data while overstating its safety controls.
Install only if you are comfortable giving the agent broad browser control. Avoid using it on authenticated, internal, financial, admin, or private sites unless you explicitly approve each action, and treat screenshots, extracted HTML/text, uploaded files, cookies, and auth state as sensitive. Prefer isolated test accounts and pinned dependencies before production use.
src/browser.py:44Unrestricted URL Navigation Enables Server-Side Request Forgery and Local Network Access
src/browser.py:194Caller-Controlled Values Are Interpolated into Executable JavaScript
requirements.txt:1Unpinned Dependencies and Global Latest-Package Installation Create Supply-Chain Exposure
Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.
## Adding New Commands to the Skill
Update SKILL.md when the upstream CLI adds new commands.
- Keep the Installation section
- Add new commands in the correct category
- Include usage examples
The class exposes a direct eval(javascript) wrapper over page.evaluate, allowing any caller of the skill to execute arbitrary JavaScript in the context of whatever page is open. In an agent setting, this bypasses the safer higher-level browser actions and can be abused to extract sensitive page data, manipulate forms invisibly, or trigger unsafe workflows on trusted sites.
The README explicitly documents saving/loading auth state and manipulating cookies, but does not warn that these artifacts can contain live session tokens and account credentials. In an AI-agent/browser-automation context, this increases the risk of unsafe persistence, accidental reuse, leakage to logs/workspaces, or cross-task account compromise if operators treat session files as harmless.
The examples demonstrate login, form filling, checkbox selection, and submit actions without warning that these commands can trigger real-world state changes on remote systems. For AI agents, this omission can normalize blind execution of side-effecting actions, leading to unintended submissions, account actions, purchases, or data modification when examples are adapted to production targets.
The overview and feature description present browser automation as generic and AI-friendly without warning that it can navigate real sites, submit forms, click destructive actions, or alter remote state. In an agent setting, omission of these guardrails increases the risk that autonomous workflows perform unintended transactions, account changes, or policy-violating actions on live services.
The examples normalize use with credentials, uploads, screenshots, and extraction workflows but provide no privacy, secrecy, or data-handling warnings. That is risky because agents may capture secrets, upload sensitive local files, or exfiltrate page contents/screenshots from authenticated sessions without clear constraints.
Skill grants unrestricted tool access without appropriate constraints. An agent with unfettered tool access can perform arbitrary actions including file modification, network requests, and code execution.
### Safe Commands
All commands are safe and do not execute arbitrary code:
- No shell injection possible
- No command injection possible
The documentation makes a broad safety claim that all commands are safe and do not execute arbitrary code, yet the skill explicitly exposes an eval command that runs user-supplied JavaScript in the browser context. This can mislead downstream agents or users into treating the tool as harmless, increasing the chance of unsafe automation against sensitive pages, token-bearing sessions, or untrusted sites.
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.
print(" open <url> Open a URL")
print(" snapshot [-i] [-c] [-d] Get accessibility tree")
print(" click <selector> Click element")
print(" fill <sel> <text> Fill input field")
print(" type <sel> <text> Type text")
print(" screenshot [path] Take screenshot")
print(" get_text <sel> Get text content")
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.
print(" open <url> Open a URL")
print(" snapshot [-i] [-c] [-d] Get accessibility tree")
print(" click <selector> Click element")
print(" fill <sel> <text> Fill input field")
print(" type <sel> <text> Type text")
print(" screenshot [path] Take screenshot")
print(" get_text <sel> Get text content")
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.
print(" open <url> Open a URL")
print(" snapshot [-i] [-c] [-d] Get accessibility tree")
print(" click <selector> Click element")
print(" fill <sel> <text> Fill input field")
print(" type <sel> <text> Type text")
print(" screenshot [path] Take screenshot")
print(" get_text <sel> Get text content")
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.
print(" open <url> Open a URL")
print(" snapshot [-i] [-c] [-d] Get accessibility tree")
print(" click <selector> Click element")
print(" fill <sel> <text> Fill input field")
print(" type <sel> <text> Type text")
print(" screenshot [path] Take screenshot")
print(" get_text <sel> Get text content")
The CLI advertises an eval <js> command that executes JavaScript, which is a safety-sensitive operation because it can modify page state or trigger unintended actions. In this file there is no confirmation prompt or warning text describing the risks of executing arbitrary code.
The CLI help and command branch describe this action as 'type', which implies simulated keystrokes, but the implementation invokes agent.fill(args[0], args[1]) instead. This is an active contradiction between the documented command behavior and the code path executed.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
elif command == 'install':
import subprocess
print("Installing Playwright browsers...")
result = subprocess.run([sys.executable, '-m', 'playwright', 'install'], capture_output=True, text=True)
if result.returncode == 0:
print("✓ Playwright browsers installed successfully")
else:
The documentation encourages screenshots and page-content capture without warning that these operations may collect sensitive data such as credentials, tokens, personal information, or confidential on-screen content. In an agent/browser automation context, users may apply these examples to authenticated or internal pages, increasing the chance of unintended data exposure through saved files or logs.
The upload method sends local files from user-supplied paths into a browser page via set_input_files, which can expose user data to a remote site. The code contains no confirmation prompt, logging, or warning comment/docstring explaining this privacy-impacting action beyond the neutral method name.
Arbitrary JavaScript execution is exposed without any warning, gating, or policy checks. In a browser agent, undisclosed script execution increases the risk of hidden DOM scraping, token extraction from page context, and actions that are not apparent from the higher-level API surface.
The screenshot [path] command writes an image file to disk, which is a file-modifying operation. Although success is printed after execution, the help/description does not warn beforehand that invoking the command will create or overwrite a local file.
The install command launches a subprocess to install Playwright browsers, which changes the local system state. While the code prints a message at runtime, the command listing does not warn users that invoking install will download and install browser binaries.
The 'Persistent Sessions' section shows a flow where a second BrowserAgent instance is 'Already authenticated', but the same example states 'Save state (cookies, localStorage)' and marks it as '(Implementation needed)'. This actively misleads readers about the skill's actual behavior by implying persisted authentication/session reuse that the documentation itself indicates is not implemented.
The dependency is specified with a lower-bound constraint only, which makes builds non-reproducible and allows later releases to be installed without review. This increases supply-chain risk because a vulnerable or breaking upstream version could be pulled in at install time.
playwright>=1.40.0
click>=8.1.0
pydantic>=2.5.0
rich>=13.7.0
The click dependency is unpinned, so installations may resolve to different versions over time, including versions with known security defects. Because command-line frameworks can influence command execution paths, leaving this dependency floating meaningfully increases supply-chain and exposure risk.
playwright>=1.40.0
click>=8.1.0
pydantic>=2.5.0
rich>=13.7.0
The manifest does not pin click, and there is at least one known advisory affecting some versions, so it is impossible to verify from this file whether deployment will resolve to a safe release. In this context, that uncertainty is itself dangerous because a CLI-oriented package with command injection history could expose users if an affected version is installed.
The pydantic dependency is unpinned, which allows future installs to select different versions, potentially including releases affected by denial-of-service or parsing-related vulnerabilities. For a validation library that processes untrusted input, version drift can directly affect security posture.
playwright>=1.40.0
click>=8.1.0
pydantic>=2.5.0
rich>=13.7.0