Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

dont expose debug port on all addresses and keep security enabled by default

Nick Sweetingf6eb9af5856e
diff --git a/browser_use/browser/browser.py b/browser_use/browser/browser.py
index 28f9509b5..9e7d8140a 100644
--- a/browser_use/browser/browser.py
+++ b/browser_use/browser/browser.py
@@ -56,7 +56,7 @@ class BrowserConfig(BaseModel):
headless: False
Whether to run browser in headless mode (not recommended)
- disable_security: True
+ disable_security: False
Disable browser security features (required for cross-origin iframe support)
extra_browser_args: []
@@ -96,7 +96,7 @@ class BrowserConfig(BaseModel):
extra_browser_args: list[str] = Field(default_factory=list)
headless: bool = False
- disable_security: bool = True
+ disable_security: bool = False # disable_security=True is dangerous as any malicious URL visited could embed an iframe for the user's bank, and use their cookies to steal money
deterministic_rendering: bool = False
keep_alive: bool = Field(default=False, alias='_force_keep_browser_alive') # used to be called _force_keep_browser_alive
@@ -261,7 +261,6 @@ class Browser:
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
if s.connect_ex(('localhost', 9222)) == 0:
chrome_args.remove('--remote-debugging-port=9222')
- chrome_args.remove('--remote-debugging-address=0.0.0.0')
browser_class = getattr(playwright, self.config.browser_class)
args = {
diff --git a/browser_use/browser/chrome.py b/browser_use/browser/chrome.py
index 60027b5c6..a829fc4ed 100644
--- a/browser_use/browser/chrome.py
+++ b/browser_use/browser/chrome.py
@@ -127,7 +127,7 @@ CHROME_ARGS = [
# chrome://inspect
'--log-level=2', # 1=DEBUG 2=WARNING 3=ERROR
'--enable-logging=stderr',
- '--remote-debugging-address=0.0.0.0',
+ # '--remote-debugging-address=127.0.0.1', <- never expose to non-localhost, would allow attacker to drive your browser from any machine
f'--remote-debugging-port={CHROME_DEBUG_PORT}',
'--enable-experimental-extension-apis', # add support for tab groups
'--disable-focus-on-load', # prevent browser from hijacking focus
diff --git a/browser_use/browser/context.py b/browser_use/browser/context.py
index 70caddafe..7ff2b5229 100644
--- a/browser_use/browser/context.py
+++ b/browser_use/browser/context.py
@@ -56,8 +56,8 @@ class BrowserContextConfig(BaseModel):
cookies_file: None
Path to cookies file for persistence
- disable_security: True
- Disable browser security features
+ disable_security: False
+ Disable browser security features (dangerous, but cross-origin iframe support requires it)
minimum_wait_page_load_time: 0.5
Minimum time to wait before getting page state for LLM input
@@ -141,7 +141,7 @@ class BrowserContextConfig(BaseModel):
maximum_wait_page_load_time: float = 5
wait_between_actions: float = 0.5
- disable_security: bool = True
+ disable_security: bool = False # disable_security=True is dangerous as any malicious URL visited could embed an iframe for the user's bank, and use their cookies to steal money
browser_window_size: BrowserContextWindowSize = Field(default_factory=lambda: {'width': 1280, 'height': 1100})
no_viewport: Optional[bool] = None
diff --git a/docs/customize/browser-settings.mdx b/docs/customize/browser-settings.mdx
index 1d7903b9e..13bdefeb3 100644
--- a/docs/customize/browser-settings.mdx
+++ b/docs/customize/browser-settings.mdx
@@ -22,7 +22,7 @@ from browser_use import BrowserConfig
# Basic configuration
config = BrowserConfig(
headless=False,
- disable_security=True
+ disable_security=False
)
browser = Browser(config=config)
@@ -38,7 +38,7 @@ agent = Agent(
- **headless** (default: `False`)
Runs the browser without a visible UI. Note that some websites may detect headless mode.
-- **disable_security** (default: `True`)
+- **disable_security** (default: `False`)
Disables browser security features. While this can fix certain functionality issues (like cross-site iFrames), it should be used cautiously, especially when visiting untrusted websites.
### Additional Settings
diff --git a/pyproject.toml b/pyproject.toml
index 2e9bf2962..bc22ea4bd 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -2,7 +2,7 @@
name = "browser-use"
description = "Make websites accessible for AI agents"
authors = [{ name = "Gregor Zunic" }]
-version = "0.1.40"
+version = "0.1.41rc2"
readme = "README.md"
requires-python = ">=3.11,<4.0"
classifiers = [