Vulnerabilities in pkg:pypi/browser-use

PACKAGE
Advisory Identifier: GHSA-x39x-9qw5-ghrf
Advisory Summary

CVE-2025-47241 is a CRITICAL (CVSS 9.3) browser use allows bypassing `allowed_domains` vulnerability (CWE-647: Use of Non-Canonical URL Paths for Authorization Decisions) affecting Browser use libraries in the PyPI ecosystem. The issue involves browser use allows bypassing `allowed_domains` by putting a decoy domain in http auth username portion of a url. Remediation is available by upgrading affected packages to version 0.1.45.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/browser-use

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/browser-use. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-x39x-9qw5-ghrf CVE-2025-47241 CRITICAL Browser Use allows bypassing `allowed_domains` by putting a decoy domain in http auth username portion of a URL
GHSA-f54f-hr32-586f - CRITICAL Duplicate Advisory: `allowed_domains` can be bypassed by putting a decoy domain in http auth username portion of a URL

CVE-2025-47241 at a Glance

CVE Identifier CVE-2025-47241
GHSA Identifier GHSA-x39x-9qw5-ghrf
Severity CRITICAL
CVSS v3.1 Base Score 9.3
CWE Classification CWE-647: Use of Non-Canonical URL Paths for Authorization Decisions
Affected Product Browser use
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 9.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity None (I:N)
Availability Low (A:L)

How to Fix CVE-2025-47241

To remediate this vulnerability, upgrade all affected Browser use dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

browser-use fixed: 0.1.45
pip install browser-use>=0.1.45
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show browser-use

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2025-47241, inspect your installed packages using pip:

pip show browser-use

Analyze the terminal output to locate any version of Browser use in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.1.45), your application is affected.

Note: The pip show browser-use command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-647: Use of Non-Canonical URL Paths for Authorization Decisions, where the product defines policy namespaces and makes authorization decisions based on the assumption that a url is canonical. this can allow a non-canonical url to bypass the authorization. In Browser use, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary During a manual source code review, [**ARIMLABS.AI**](https://arimlabs.ai) researchers identified that the `browser_use` module includes an embedded whitelist functionality to restrict URLs that can be visited. This restriction is enforced during agent initialization. However, it was discovered that these measures can be bypassed, leading to severe security implications. ### Details **File:** `browser_use/browser/context.py` The `BrowserContextConfig` class defines an `allowed_domains` list, which is intended to limit accessible domains. This list is checked in the `_is_url_allowed()` method before navigation: ```python @dataclass class BrowserContextConfig: """ [STRIPPED] """ cookies_file: str | None = None minimum_wait_page_load_time: float = 0.5 wait_for_network_idle_page_load_time: float = 1 maximum_wait_page_load_time: float = 5 wait_between_actions: float = 1 disable_security: bool = True browser_window_size: BrowserContextWindowSize = field(default_factory=lambda: {'width': 1280, 'height': 1100}) no_viewport: Optional[bool] = None save_recording_path: str | None = None save_downloads_path: str | None = None trace_path: str | None = None locale: str | None = None user_agent: str = ( 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36' ) highlight_elements: bool = True viewport_expansion: int = 500 allowed_domains: list[str] | None = None include_dynamic_attributes: bool = True _force_keep_context_alive: bool = False ``` The _is_url_allowed() method is responsible for checking whether a given URL is permitted: ```python def _is_url_allowed(self, url: str) -> bool: """Check if a URL is allowed based on the whitelist configuration.""" if not self.config.allowed_domains: return True try: from urllib.parse import urlparse parsed_url = urlparse(url) domain = parsed_url.netloc.lower() # Remove port number if present if ':' in domain: domain = domain.split(':')[0] # Check if domain matches any allowed domain pattern return any( domain == allowed_domain.lower() or domain.endswith('.' + allowed_domain.lower()) for allowed_domain in self.config.allowed_domains ) except Exception as e: logger.error(f'Error checking URL allowlist: {str(e)}') return False ``` The core issue stems from the line `domain = domain.split(':')[0]`, which allows an attacker to manipulate basic authentication credentials by providing a username:password pair. By replacing the username with a whitelisted domain, the check can be bypassed, even though the actual domain remains different. ### Proof of Concept (PoC) Set allowed_domains to ['example.com'] and use the following URL: https://example.com:pass@localhost:8080 This allows bypassing all whitelist controls and accessing restricted internal services. ### Impact - Affected all users relying on this functionality for security. - Potential for unauthorized enumeration of localhost services and internal networks. - Ability to bypass domain whitelisting, leading to unauthorized browsing.

CVE-2025-47241 Affected Browser use Versions

1 component(s)
Fixed Versions:
0.1.45
Product / Package Ecosystem Affected Versions Fixed Version
browser-use
PyPI
< 0.1.45
0.1.45

References

Frequently Asked Questions

What is CVE-2025-47241?
CVE-2025-47241 is a security vulnerability in Browser use involving Browser Use allows bypassing `allowed_domains` by putting a decoy domain in http auth username portion of a URL under CWE-647: Use of Non-Canonical URL Paths for Authorization Decisions.
Which Browser use versions are affected?
Affected versions include releases prior to 0.1.45 across affected packages: browser-use.
What version fixes CVE-2025-47241?
Upgrading to 0.1.45 (or the latest patched release for your respective branch) resolves the vulnerability.
Is browser-use affected?
Yes, browser-use is affected in releases prior to 0.1.45. Upgrade your dependency to 0.1.45 or later.
What is the CVSS score of CVE-2025-47241?
CVE-2025-47241 has a CVSS v3.1 base score of 9.3 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:L.
What CWE is associated with CVE-2025-47241?
CVE-2025-47241 is classified under CWE-647: Use of Non-Canonical URL Paths for Authorization Decisions (The product defines policy namespaces and makes authorization decisions based on the assumption that a URL is canonical. This can allow a non-canonical URL to bypass the authorization.).
How can I check PyPI dependencies for CVE-2025-47241?
Run the dependency tree command: 'pip show browser-use'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-x39x-9qw5-ghrf",
  "modified" : "2025-05-05T18:25:04Z",
  "published" : "2025-05-05T18:25:04Z",
  "aliases" : [ "CVE-2025-47241" ],
  "summary" : "Browser Use allows bypassing `allowed_domains` by putting a decoy domain in http auth username portion of a URL",
  "details" : "### Summary  \nDuring a manual source code review, [**ARIMLABS.AI**](https://arimlabs.ai) researchers identified that the `browser_use` module includes an embedded whitelist functionality to restrict URLs that can be visited. This restriction is enforced during agent initialization. However, it was discovered that these measures can be bypassed, leading to severe security implications.  \n\n### Details  \n**File:** `browser_use/browser/context.py`  \n\nThe `BrowserContextConfig` class defines an `allowed_domains` list, which is intended to limit accessible domains. This list is checked in the `_is_url_allowed()` method before navigation:\n\n```python\n@dataclass\nclass BrowserContextConfig:\n    \"\"\"\n    [STRIPPED]\n    \"\"\"\n    cookies_file: str | None = None\n    minimum_wait_page_load_time: float = 0.5\n    wait_for_network_idle_page_load_time: float = 1\n    maximum_wait_page_load_time: float = 5\n    wait_between_actions: float = 1\n\n    disable_security: bool = True\n\n    browser_window_size: BrowserContextWindowSize = field(default_factory=lambda: {'width': 1280, 'height': 1100})\n    no_viewport: Optional[bool] = None\n\n    save_recording_path: str | None = None\n    save_downloads_path: str | None = None\n    trace_path: str | None = None\n    locale: str | None = None\n    user_agent: str = (\n        'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36'\n    )\n\n    highlight_elements: bool = True\n    viewport_expansion: int = 500\n    allowed_domains: list[str] | None = None\n    include_dynamic_attributes: bool = True\n\n    _force_keep_context_alive: bool = False\n```\nThe _is_url_allowed() method is responsible for checking whether a given URL is permitted:\n```python\ndef _is_url_allowed(self, url: str) -> bool:\n    \"\"\"Check if a URL is allowed based on the whitelist configuration.\"\"\"\n    if not self.config.allowed_domains:\n        return True\n\n    try:\n        from urllib.parse import urlparse\n\n        parsed_url = urlparse(url)\n        domain = parsed_url.netloc.lower()\n\n        # Remove port number if present\n        if ':' in domain:\n            domain = domain.split(':')[0]\n\n        # Check if domain matches any allowed domain pattern\n        return any(\n            domain == allowed_domain.lower() or domain.endswith('.' + allowed_domain.lower())\n            for allowed_domain in self.config.allowed_domains\n        )\n    except Exception as e:\n        logger.error(f'Error checking URL allowlist: {str(e)}')\n        return False\n```\nThe core issue stems from the line `domain = domain.split(':')[0]`, which allows an attacker to manipulate basic authentication credentials by providing a username:password pair. By replacing the username with a whitelisted domain, the check can be bypassed, even though the actual domain remains different.\n### Proof of Concept (PoC)\n\nSet allowed_domains to ['example.com'] and use the following URL:\n\nhttps://example.com:pass@localhost:8080\n\nThis allows bypassing all whitelist controls and accessing restricted internal services.\n### Impact\n\n- Affected all users relying on this functionality for security.\n- Potential for unauthorized enumeration of localhost services and internal networks.\n- Ability to bypass domain whitelisting, leading to unauthorized browsing.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "browser-use"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.1.45"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.1.44"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/browser-use/browser-use/security/advisories/GHSA-x39x-9qw5-ghrf"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-47241"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/browser-use/browser-use/pull/1561"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/browser-use/browser-use"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/browser-use/browser-use/releases/tag/0.1.45"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-647" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-05-05T18:25:04Z",
    "nvd_published_at" : null
  }
}