Email generators escape their inputs inconsistently
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 68/100
- Issue-Typ
- Refactoring
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Ruhig
- Tech-Stack
- typescript
- Bereich
- backend
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 4
- Forks
- 0
- Ø Merge
- 8 Std. 37 Min.
- Gemergte PRs (30 T.)
- 3
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Hat eine 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 Garvan-Data-Science-Platform/ctrl
-
backend enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 63/100
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 82/100
-
admin-client backend bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
-
backend bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Garvan-Data-Science-Platform/ctrl#970 · 1 Kommentar ·
-
backend bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Alle Issues in Garvan-Data-Science-Platform/ctrl
Ähnliche Issues
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
-
bug needs triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
DSpace/dspace-angular#6511 ·
Maintainer antworten meist innerhalb von 1 Tag
-
area: frontend area:byok bug severity:low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
Maintainer antworten meist innerhalb von 1 Tag
-
Phone app shows Unknown for a remote machine whose key changedEvtl. vergeben @janicduplessis hat das heute übernommen. Offenarea: mobile priority: P3 type: bug
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
appandflow/stim#5006 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Area - Local to Cloud Bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
microsoft/vscode-mssql#23209 ·
Maintainer antworten meist innerhalb von 1 Tag