[Bug]: GraphQL has no complexity or alias limit
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 45/100
Direção de pesquisa
Start at src/api/schema.rs around line 112, where limit_depth(16) is set on the schema builder, and read the surrounding schema construction plus the expensive root fields (library listings, probes) mentioned in the issue. Read the async-graphql docs for limit_complexity and the complexity field attribute, then decide a cost budget and whether alias/root-field caps are needed. Done means a schema test showing an over-cost query (e.g. one field aliased hundreds of times) is rejected while normal queries still pass; no such test file exists yet, so one will have to be added.
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
Other
What happened?
The schema only sets limit_depth(16) (src/api/schema.rs:112). One request can alias an expensive field (like library listings or probes) hundreds of times, and any signed-in user can make the server do a lot of work with it.
Expected behavior
Requests over a reasonable cost are rejected.
Suggested fix
Add .limit_complexity(…) (with complexity on expensive fields) and cap aliases or the number of root fields per request.
- 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