T09 · Insecure Skill Coding Practices
- Location
scripts/hermes_browser_provision.py:211- Finding
Unauthenticated Persistent Browser Debugging Endpoint Exposes Authenticated Sessions
- Content
View full analysis
Vulnerability Details
File Location:
scripts/hermes_browser_provision.py, lines 37, 159, and 211–224
Vulnerability Type: Unauthenticated Chrome DevTools Protocol exposure and insufficient endpoint identity validation
Risk Level: HighVulnerable Code
python BASE_PORT = int(os.environ.get("HERMES_BROWSER_BASE_PORT", "9410"))python cur.setdefault("dir", str(home / "browser-profiles" / name))python def start_instance(name, info, headless=True): port, udd = info["port"], info["dir"] if is_alive(port): v = cdp_get(port, "/json/version") or {} print(f" [=] {name:<12} :{port} Already running {v.get('Browser', '')}") return True Path(udd).mkdir(parents=True, exist_ok=True) exe = find_browser(info.get("binary", "chrome")) or find_browser("chrome") if not exe: print(f" [!] {name}: Browser executable not found") return False args = [exe, f"--remote-debugging-port={port}", f"--user-data-dir={udd}", "--no-first-run", "--no-default-browser-check", "--disable-sync", "--disable-background-networking", "--disable-features=Translate"]Technical Analysis
The provisioner launches Chrome-compatible browsers with a persistent
user-data-dirand a fixed TCP Chrome DevTools Protocol port. These persistent profiles are expressly intended to retain authenticated login state.CDP does not provide application-level authentication in this configuration. Although the endpoint is accessed through
127.0.0.1, loopback TCP does not impose a per-user authorization boundary. Another local process or OS user able to connect to the port can therefore interact with the browser debugging interface.Port allocation starts at the predictable default port 9410. Before launching a browser,
start_instance()callsis_alive(), which only checks whether/json/versionreturns parseable JSON. It d ...[truncated 2518 chars]- Remediation
View remediation
Remediation Suggestions
- Avoid exposing persistent authenticated browser profiles through an unauthenticated TCP debugging endpoint. Prefer a per-user IPC mechanism or an authenticated local proxy protected by OS-level access controls.
- Use unpredictable, per-instance endpoint assignments rather than allocating ports sequentially from a fixed default.
- Record the launched browser PID and verify its owner, executable path, command line, debugging port, and
user-data-dirbefore reusing an existing endpoint. - If a configured port is already occupied by a process that cannot be positively associated with the recorded instance, fail closed instead of accepting it as alive.
- Verify more than
/json/version; correlate the CDP response with trusted process metadata and the expected profile. - Apply owner-only permissions to the instance state file, Hermes configuration files, and persistent browser profile directories.
- Clearly document that persistent CDP profiles contain sensitive authenticated state and must not be used on a host where untrusted local users or processes can access their endpoints.
