[Bug]: Clip pages trust X-Forwarded-Host/Proto from any client
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- Ein halber Tag
- Anfängerfreundlichkeit
- 68/100
Rechercherichtung
Start at origin() in src/api/clips.rs around line 1620 and see how the built URL feeds og:url, og:image and the <video src>. Then read state.public_url() and the throttle's network.trusted-proxies / network.trusts_proxy check to reuse that trust decision instead of inventing one. Done means a request with X-Forwarded-Host: evil.example yields public-url (or Host) in the page, with a test covering the untrusted and trusted-proxy cases.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
[!NOTE]
This issue was written by Claude (Claude Opus 5.5) from a code review session with @PhrolovaMoe. It was found by reading the code and hasn't been reproduced on a running server.
Version
0.40.0 (feat/desktop, 017a837b)
Area
Clips
What happened?
origin() in the clip page builds URLs from X-Forwarded-Proto and X-Forwarded-Host sent by anyone (src/api/clips.rs:1620). It ignores [network] trusted-proxies, which the throttle respects, and the configured public-url. Those URLs go into the page's og:url, og:image and <video src>.
Steps to reproduce
Request /c/<code> with X-Forwarded-Host: evil.example: the page's video and meta tags point at evil.example.
Expected behavior
Clip pages use public-url when set, and only take forwarded headers from trusted proxies otherwise.
Suggested fix
Use state.public_url() first; fall back to forwarded headers only when the peer passes network.trusts_proxy, then to Host.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 4
- Forks
- 1
- Ø Merge
- 4 Std. 49 Min.
- Gemergte PRs (30 T.)
- 5
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Kein Beitragsleitfaden
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 tinystream-dev/tinystream
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
tinystream-dev/tinystream#132 ·
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
tinystream-dev/tinystream#131 ·
-
bug
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
tinystream-dev/tinystream#129 ·
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
tinystream-dev/tinystream#128 ·
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
tinystream-dev/tinystream#124 ·
Alle Issues in tinystream-dev/tinystream
Ähnliche Issues
-
Console writes URL credentials to the local log, though AGENTS.md says secrets never reach diskOffen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 86/100
sandbox-quantum/switch#2163 ·
Maintainer antworten meist innerhalb von 1 Tag
-
automated issue report
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
area/dashboard kind/bug QA/dev-automation
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 75/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug pydanty:is-working
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
pydantic/pydantic-ai#13939 ·
Maintainer antworten meist innerhalb von 1 Tag
-
self-host
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
funmusicplace/mirlo#2625 ·
Maintainer antworten meist innerhalb von 1 Tag