Email generators escape their inputs inconsistently
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 68/100
- Tipo de issue
- Refatoração
- Clareza
- Claramente especificada
- Status de atividade
- Pouca atividade
- Stack de tecnologia
- typescript
- Domínio
- backend
Direção de pesquisa
Start with the six generator functions in application/common/src/emails/generate.ts and compare their replaceAll chains with adminInvite.html and adminPasswordInvite.html. Check how the existing generators apply escapeHtml, then run the relevant email tests. Done means the shared render helper escapes consistently and the email templates still render correctly.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Four of the six generators in application/common/src/emails/generate.ts escape their inputs with escapeHtml. generateAdminInviteEmail and generateAdminPasswordInviteEmail don't.
Not #739. That one is about sanitising admin-authored HTML stored in the database, fixed with DOMPurify. This is the generator layer escaping inconsistently, and fixing #739 wouldn't touch it. @ignatiusm flagged escaping in this file reviewing #810 and pointed at #739 from there, so filing separately rather than letting it get lost inside that one. Also not #761, which is about template organisation and styling.
Both unescaped generators take one link built from process.env.ADMIN_HOSTNAME plus a crypto-random token, so nothing user-controlled reaches them. Worth fixing because the next person to add a parameter to either function has no reason to expect it won't be escaped.
Fix: the six generators are near-identical replaceAll chains, so rather than editing two functions in place, extract a shared render helper that always escapes. That collapses the duplication and removes the asymmetry in one change.
Related: #739, #761, #810. Files: application/common/src/emails/generate.ts, adminInvite.html, adminPasswordInvite.html.
- Linguagem predominante
- TypeScript
- Estrelas
- 4
- Forks
- 0
- Merge médio
- 14h 50min
- PRs com merge (30d)
- 5
Preparar o ambiente
- Inclui um Dockerfile ou arquivo Docker Compose
- Tem um modelo de pull request
- Ler o 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 Garvan-Data-Science-Platform/ctrl
-
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 82/100
-
admin-client backend bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
-
backend bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Garvan-Data-Science-Platform/ctrl#970 · 1 comentário ·
-
backend bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
-
backend bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Todas as issues de Garvan-Data-Science-Platform/ctrl
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 73/100
anomalyco/opencode#56380 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
-
BUG | `MCP 服务器` | 全局层行的停用/启用与删除报 404 server row not found,编辑保存会在 profile 层复制出重复行Talvez já em andamento @w6242652 assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Chocobozzz/PeerTube#7832 ·
Mantenedores costumam responder em até 3 dias
-
Pay to use?Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 66/100
darkreader/darkreader#16108 · 1 comentário ·
Mantenedores costumam responder em até 2 dias