Skip to content

[SECURITY][OUTBOUND EMAIL] Replace the arbitrary HTML admin relay with approved templates #194

Description

@Obiajulu-gif

Summary

Any administrator can submit arbitrary recipients, subject, and 50 KB of HTML directly to the email provider. A compromised admin session becomes a general-purpose phishing and tracking relay outside normal notification policy.

Repository evidence

  • app/api/send-email/route.ts:27-31 accepts raw to, subject, and html.
  • app/api/send-email/route.ts:68-70 forwards the HTML unchanged to sendEmail.

Scope

  • Expose allowlisted template IDs with typed, escaped variables and recipient-policy checks.
  • Require elevated approval for exceptional broadcasts and audit the template/version, not raw sensitive content.

Acceptance criteria

  • Normal callers cannot submit arbitrary HTML or uncontrolled external recipients.
  • Links, subjects, and variables are safely encoded and previewable.

Tests

  • Cover HTML/script injection, remote tracking markup, recipient overflow, unauthorized templates, and approved sends.

Non-goals

  • Building a marketing campaign platform.

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third Campaign

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions