# GHSA-3CWV-4W3R-XQFF: AutoGPT Classic: incomplete URL validation in forge allows SSRF in browser commands

- Database: GitHub
- Severity: CVSS 8.6 (High)
- Published: 2026-07-14
- Modified: 2026-10-24

## Affected versions

- autogpt-classic (PyPI): fixed in 0.6.66

## Description

#### Summary
The URL validation mechanism ([validate_url](cci:1://file:///root/llm-project/AutoGPT/classic/forge/forge/utils/url_validator.py:10:0-41:35)) in the `forge` component is insufficient. It only verifies that the URL scheme is `http` or `https` but fails to block access to private IP ranges, loopback addresses (localhost), or link-local addresses. This allows the Agent (via [read_webpage](cci:1://file:///root/llm-project/AutoGPT/classic/forge/forge/components/web/selenium.py:97:4-208:30) command) to access internal network resources and cloud metadata services, leading to a Server-Side Request Forgery (SSRF) vulnerability.

### Details
The vulnerability is located in [classic/forge/forge/utils/url_validator.py](cci:7://file:///root/llm-project/AutoGPT/classic/forge/forge/utils/url_validator.py:0:0-0:0).

The [validate_url](cci:1://file:///root/llm-project/AutoGPT/classic/forge/forge/utils/url_validator.py:10:0-41:35) decorator is intended to secure URL inputs for the agent's web browsing capabilities. However, the current implementation only performs a simple regex check:

```python
# classic/forge/forge/utils/url_validator.py
if not re.match(r"^https?://", url):
    raise ValueError("Invalid URL format: URL must start with http:// or https://")
if check_local_file_access(url):
    raise ValueError("Access to local files is restricted")
```

It **completely fails** to validate the hostname or resolved IP address against private network ranges (e.g., `127.0.0.0/8`, `10.0.0.0/8`, `192.168.0.0/16`) or cloud metadata IP (`169.254.169.254`).

As a result, the [read_webpage](cci:1://file:///root/llm-project/AutoGPT/classic/forge/forge/components/web/selenium.py:97:4-208:30) function in [classic/forge/forge/components/web/selenium.py](cci:7://file:///root/llm-project/AutoGPT/classic/forge/forge/components/web/selenium.py:0:0-0:0), which is decorated with `@validate_url`, accepts and visits internal URLs when instructed by a user or a malicious prompt injection.

### PoC
To reproduce this vulnerability, you can run a local mock server and attempt to access it using the [validate_url](cci:1://file:///root/llm-project/AutoGPT/classic/forge/forge/utils/url_validator.py:10:0-41:35) logic.

1.  **Start a mock internal service** (e.g., on port 1337):
    ```python
    # http_server.py
    import http.server, socketserver
    PORT = 1337
    class Handler(http.server.SimpleHTTPRequestHandler):
        def do_GET(self):
            self.send_response(200)
            self.wfile.write(b"CRITICAL_INTERNAL_SECRET")
    with socketserver.TCPServer(("localhost", PORT), Handler) as httpd:
        httpd.serve_forever()
    ```

2.  **Run the exploit script** (verifying the validator allows the connection):
    ```python
    # poc.py
    import sys, os
    # Adjust path to point to your AutoGPT/classic/forge directory
    sys.path.append(os.path.abspath("classic/forge"))
    from forge.utils.url_validator import validate_url

    class MockComponent:
        @validate_url
        def read_webpage(self, url):
            print(f"Validator ALLOWED access to: {url}")

    # This should raise a ValueError if properly secured, but it does NOT.
    try:
        MockComponent().read_webpage(url="http://localhost:1337")
        print("[!] Vulnerability Reproduced: Validator allowed localhost access.")
    except ValueError as e:
        print(f"[-] Blocked: {e}")
    ```

3.  **Observation**: The script outputs "Validator ALLOWED access to: http://localhost:1337".

### Impact
This vulnerability allows a malicious actor (via direct prompt to the agent or prompt injection from a visited webpage) to:
1.  **Exfiltrate Cloud Credentials**: Access `http://169.254.169.254/latest/meta-data/` to steal AWS/GCP/Azure IAM credentials if the agent is running in a cloud environment.
2.  **Internal Network Reconnaissance**: Scan for open ports on [localhost](cci:1://file:///root/llm-project/AutoGPT/llm-enhance/cve-finding/SSRF/ssrf_validator_poc.py:24:4-51:55) or other devices in the local network (e.g., `http://192.168.1.1`).
3.  **Interact with Internal Services**: Send GET requests to internal APIs or databases that expose HTTP interfaces without authentication (assuming they are safe behind a firewall).

### Release references

The patched-version metadata for this advisory points to the following release(s):

- [autogpt-platform-beta-v0.6.66](https://github.com/Significant-Gravitas/AutoGPT/releases/tag/autogpt-platform-beta-v0.6.66)

## References

- https://github.com/Significant-Gravitas/AutoGPT/security/advisories/GHSA-3cwv-4w3r-xqff

Page: https://cve.now/GHSA-3CWV-4W3R-XQFF

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
