client-proxy: WARN "invalid host" spam from unroutable bare-IP Host requests (external probes)
Maintainer antworten meist innerhalb von 2 Tagen
@AdaAibaby arbeitet bereits daran.
Seit 02.11.2026.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 72/100
Rechercherichtung
Die Änderung gehört in den ErrInvalidHost-Zweig von handler() in packages/shared/pkg/proxy/handler.go, der isLocalRequestHost aus host.go und eine Prüfung des Routing-Headers verwendet. Lies zuerst diese Hilfsfunktionen und füge dann einen Unit-Test für einen Host hinzu, der nur eine IP-Adresse ist, ohne die Header E2b-Sandbox-Id/E2b-Sandbox-Port. Fertig ist, wenn dieser Fall auf Debug-Ebene loggt, ein fehlerhafter Domain-Host weiterhin auf Warn-Ebene loggt und die 400-Antwort unverändert bleibt. Bestätige die Richtung mit einem Maintainer, bevor du den PR öffnest.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Summary
client-proxy logs WARN "invalid host" for every inbound request whose Host is a bare IP address with no sandbox routing headers. On any proxy with a public endpoint these arrive continuously from external scanners, health probes, and stale clients still pointed at an old node IP, producing ~1 line/second of WARN noise that drowns real warnings.
Observed (client-proxy):
WARN invalid host {"service":"client-proxy","host":"118.196.30.209"}
WARN invalid host {"service":"client-proxy","host":"118.196.30.209"}
... (repeats every ~1s)
Why these are expected, not warnings
packages/shared/pkg/proxy/handler.go rejects the request with ErrInvalidHost and returns 400, which is correct. But a bare-IP Host cannot encode sandbox routing ({port}-{sandboxID}.{domain}) — as isLocalRequestHost in host.go documents, header-based routing is the only mechanism that can work for an IP host. So an IP Host that also carries no routing headers (E2b-Sandbox-Id / E2b-Sandbox-Port) is, by construction, unroutable. Rejecting it is the designed behavior; logging it at WARN on every hit just turns routine external traffic into log spam.
(Header-based routing for IP hosts — #2581 — is unaffected: an IP host with routing headers routes fine and never reaches this branch.)
Proposal
In the ErrInvalidHost branch of handler(), log at Debug when the host is a raw IP / localhost and no routing headers are present (isLocalRequestHost(r.Host) && !hasRoutingHeaders(r.Header)), and keep Warn for a genuinely suspect invalid host (a malformed domain host), which is rare and worth visibility. Status code stays 400 in both cases — this only changes log level, not behavior.
Environment
Reproduced on client-proxy main; the proxy sits behind a public ingress, so any internet host hitting the raw IP triggers it. Same code path in api (OpenAPI validator logs the same raw-IP / requests as 404 no matching operation), but the client-proxy WARN is the loudest.
Happy to send the PR (small, with a unit test) if the direction is acceptable.
- Vorherrschende Sprache
- Go
- Sterne
- 1.8k
- Forks
- 503
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
Startet den Dev-Container des Projekts im Browser, mit Ihrem eigenen GitHub-Konto.
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus e2b-dev/runtime
-
orchestrator: NFS-cache "cache path is not set" WARN logged on every build/launch instead of onceEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 2 Tagen
-
api: autoPause default is declared in the spec and in a Go constant with no test keeping them in syncEvtl. vergeben @AdaAibaby hat das vor 4 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 2 Tagen
-
[Bug]: flock() on a mounted volume hangs forever (mount is missing `nolock`)Evtl. vergeben @AdaAibaby hat das vor 56 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 2 Tagen
-
sandbox cache: StartRemoving state transition not broadcast, all allocations see stale Running stateEvtl. wieder frei Ein Pull Request dazu wurde ohne Merge geschlossen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
Maintainer antworten meist innerhalb von 2 Tagen
Alle Issues in e2b-dev/runtime
Ähnliche Issues
-
fix(scan): validate and normalize output format in validate-contractEvtl. vergeben @WKr1shna hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug good first issue help wanted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
-
Won't Fix
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
microsoft/TypeScript#65107 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
argoproj/argo-workflows#17397 ·
Maintainer antworten meist innerhalb von 1 Tag