GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||
GeezerVison is showing github.com — feat(sanic): Add `sentry.is_localhost` for inbound filters by sentrivana · Pull Request #7783 · getsentry/sentry-python Conversation
sentrivana
force-pushed
the
ivana/is-localhost-3-sanic
branch
from
6a48aa5 to
316a463
Compare
sentry.is_localhost for inbound filters
sentrivana
marked this pull request as ready for review
|
There was an error while loading. Please reload this page.
Codecov Results 📊✅ 130355 passed | ⏭️ 7185 skipped | Total: 137540 | Pass Rate: 94.78% | Execution Time: 438m 12s 📊 Comparison with Base Branch
All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 2554 uncovered lines. Coverage diff@@ Coverage Diff @@ ## master #PR +/-## ========================================== + Coverage 90.26% 90.26% —% ========================================== Files 195 195 — Lines 26225 26226 +1 Branches 9776 9776 — ========================================== + Hits 23672 23672 — - Misses 2553 2554 +1 - Partials 1483 1484 +1 Generated by Codecov Action |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
316a463 to
3d65d79
Compare
There was an error while loading. Please reload this page.
b6a44e8 to
eac5409
Compare
eac5409 to
bfc7e34
Compare
| from sentry_sdk.utils import ( | ||
| CONTEXTVARS_ERROR_MESSAGE, | ||
| HAS_REAL_CONTEXTVARS, | ||
| _is_localhost, |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
IPv6 localhost hosts are not recognized by the localhost helper
When the client IP is absent or non-loopback, _is_localhost() can miss requests whose URL or host header identifies IPv6 loopback. url_host="::1" does not match _LOCAL_DOMAINS, and splitting a header such as [::1]:8000 at the first colon produces [ rather than a hostname. Add IPv6 loopback to the host checks and parse header authorities in a way that handles bracketed IPv6 addresses.
_is_localhost() checks the client IP first, then checks url_host against _LOCAL_DOMAINS, which contains localhost and 127.0.0.1 but not ::1.split(":")[0] operation turns [::1]:8000 into [, so it cannot match a local domain.Identified by Warden · find-bugs · 9XF-TTE
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fix attempt detected (commit 96286e3)
The change adds bracket stripping for IPv6 client IPs, but _is_localhost() still does not recognize ::1 as a URL host and still splits bracketed IPv6 host headers at the first colon, so the reported host-only cases persist.
The original issue appears unresolved. Please review and try again.
Evaluated by Warden
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
bfc7e34 to
96286e3
Compare
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.