Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Email generators escape their inputs inconsistently

オープン
#940 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
リファクタリング
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
typescript
領域
backend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

backend bug enhancement

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.

主要言語
TypeScript
スター
4
フォーク
0
平均マージ
14時間 50分
マージ済み PR(30日)
5

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Garvan-Data-Science-Platform/ctrl のほかの issue

Garvan-Data-Science-Platform/ctrl の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。