getsentry / getsentry/self-hosted
Google sso auth login report 400 bad request under a proxy
- Dominant language
- Shell
- Stars
- 9.6k
- Forks
- 2k
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 12
Description
### Self-Hosted Version
25.10.0
### CPU Architecture
x86_64
### Docker Version
Docker version 28.5.1, build e180ab8
### Docker Compose Version
Docker Compose version v2.40.3
### Machine Specification
- [x] My system meets the minimum system requirements of Sentry
### Steps to Reproduce
1. my self-hosted sentry under a proxy which hijack any DNS requests to proxy server 10.11.11.11
2. when use google sso login `docker logs -f --tail 20 sentry-self-hosted-web-1` shows
```shell
File "/.venv/lib/python3.13/site-packages/urllib3/connectionpool.py", line 466, in _make_request
self._validate_conn(conn)
~~~~~~~~~~~~~~~~~~~^^^^^^
File "/.venv/lib/python3.13/site-packages/urllib3/connectionpool.py", line 1095, in _validate_conn
conn.connect()
~~~~~~~~~~~~^^
File "/.venv/lib/python3.13/site-packages/urllib3/connection.py", line 615, in connect
self.sock = sock = self._new_conn()
~~~~~~~~~~~~~~^^
File "/usr/src/sentry/src/sentry/net/http.py", line 81, in _new_conn
conn = safe_create_connection(
(self._dns_host, self.port),
...<2 lines>...
**extra_kw,
)
File "/usr/src/sentry/src/sentry/net/socket.py", line 151, in safe_create_connection
raise RestrictedIPAddress(f"({host}/{ip}) matches the URL blocklist")
sentry.exceptions.RestrictedIPAddress: (www.googleapis.com/10.11.11.11) matches the URL blocklist
08:47:11 [ERROR] django.security.RestrictedIPAddress: (www.googleapis.com/10.11.11.11) matches the URL blocklist (status_code=400 request=)
```
### Expected Result
google sso login ok
### Actual Result
400 bad request
### Event ID
_No response_
Contributor guide
Research direction
Start with sentry/net/http.py and sentry/net/socket.py, especially safe_create_connection and the RestrictedIPAddress path shown in the traceback. Reproduce Google SSO through the stated proxy and determine the intended interaction between proxy DNS resolution and the URL blocklist; done means the login succeeds without weakening the protection.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, docker-compose, python
- Domain
- authentication, devops, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100