[Bug]: Clip pages trust X-Forwarded-Host/Proto from any client
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- Meio dia
- Facilidade para iniciantes
- 68/100
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
[!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.
- Linguagem predominante
- TypeScript
- Estrelas
- 4
- Forks
- 1
- Merge médio
- 4h 49min
- PRs com merge (30d)
- 5
Preparar o ambiente
- Inclui um Dockerfile ou arquivo Docker Compose
- Sem modelo de pull request
- Sem guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de tinystream-dev/tinystream
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
tinystream-dev/tinystream#132 ·
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
tinystream-dev/tinystream#131 ·
-
bug
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
tinystream-dev/tinystream#129 ·
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
tinystream-dev/tinystream#128 ·
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
tinystream-dev/tinystream#124 ·
Todas as issues de tinystream-dev/tinystream
Issues semelhantes
-
bug frontend
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
CivicTechWR/accessible-housing-portal#578 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
nekko-labs/nekko-agent#2998 ·
Mantenedores costumam responder em até 1 dia
-
Console writes URL credentials to the local log, though AGENTS.md says secrets never reach diskAberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 86/100
sandbox-quantum/switch#2163 ·
Mantenedores costumam responder em até 1 dia
-
enhancement ux
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
lolimmlost/aidj#433 ·
Mantenedores costumam responder em até 1 dia
-
test: ipcShownDialogKeys.test.tsx can fail the unit run with 'window is not defined' after it endsAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 1 dia