Email generators escape their inputs inconsistently
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- typescript
- Lĩnh vực
- backend
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 4
- Fork
- 0
- Merge trung bình
- 14 giờ 50 phút
- Pull request đã merge (30 ngày)
- 5
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Garvan-Data-Science-Platform/ctrl
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 82/100
-
admin-client backend bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
backend bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Garvan-Data-Science-Platform/ctrl#970 · 1 bình luận ·
-
backend bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
backend bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Tất cả issue của Garvan-Data-Science-Platform/ctrl
Issue tương tự
-
Contrib indemnité de départ à la retraite : faire le pont avec le simulateur sur la page génériqueĐang mởP1
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
SocialGouv/code-du-travail-numerique#7561 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
kubernetes-sigs/headlamp#7950 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
README for cliCó thể đã có người làm @Janvi-kapoor đã nhận hôm nay. Đang mởOSCI'26
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
GauravKarakoti/SecureFlow#1308 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
vitest-dev/vitest#11577 ·
Maintainer thường phản hồi trong vòng 1 ngày