fix(dast): each browser tab gets its own browser context #1004

Merged
sharang merged 1 commits from feat/cdp-isolated-context into main 2026-11-16 08:16:50 +00:00
Owner

Refs #1000.

Problem: the pentest browser tool opened its tabs in Chrome's default context. Every pentest session on the same Chrome shared one cookie jar, so one session's login was visible to the next.

Change:

  • New compliance-dast/src/cdp.rs: one tab driven over CDP, created in its own browser context and disposed of with it on close.
  • tools/browser.rs runs on it; its own copy of the CDP plumbing is gone.
  • fill no longer echoes the typed value back (it may be a password); it reports whether the field took the value.

Tests:

  • cdp::tests::tabs_do_not_share_cookies runs against a real Chrome. It is skipped without CHROME_WS_URL, so it does not run in CI.
  • Run locally against chromedp/headless-shell on the host network: it passes. Without the separate context it fails, because the second tab sends the first tab's cookie.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9

Refs #1000. **Problem:** the pentest browser tool opened its tabs in Chrome's default context. Every pentest session on the same Chrome shared one cookie jar, so one session's login was visible to the next. **Change:** - New `compliance-dast/src/cdp.rs`: one tab driven over CDP, created in its own browser context and disposed of with it on close. - `tools/browser.rs` runs on it; its own copy of the CDP plumbing is gone. - `fill` no longer echoes the typed value back (it may be a password); it reports whether the field took the value. **Tests:** - `cdp::tests::tabs_do_not_share_cookies` runs against a real Chrome. It is skipped without `CHROME_WS_URL`, so it does not run in CI. - Run locally against `chromedp/headless-shell` on the host network: it passes. Without the separate context it fails, because the second tab sends the first tab's cookie. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
sharang added 1 commit 2026-11-16 02:32:46 +00:00
fix(dast): each browser tab gets its own browser context
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Agent integration (pull_request) Successful in 6m7s
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 20m29s
91afd32d15
The pentest browser tool opened its tabs in Chrome's default context, so
every pentest session on the same Chrome shared one cookie jar: one
session's login was visible to the next.

- New `cdp` module: one tab driven over CDP, created in its own browser
  context and disposed of with it on close.
- The browser tool runs on it; its own copy of the CDP plumbing is gone.
- `fill` no longer echoes the typed value back (it may be a password);
  it reports whether the field took it.
- Test against a real Chrome (skipped without `CHROME_WS_URL`): a second
  tab does not see the first tab's cookie. It fails without the
  separate context.

Refs #1000.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
sharang merged commit 12206bfac5 into main 2026-11-16 08:16:50 +00:00
sharang deleted branch feat/cdp-isolated-context 2026-11-16 08:16:50 +00:00
Sign in to join this conversation.