You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
sec(email): SES registration subject still built from unsanitized AccountName (PR #523 fixed only SMTP path) #544
Discovered while auditing PR #523 (which closes #401).
PR #523 wraps data.AccountName and data.Provider in sanitizeHeader() in the SMTP path (internal/email/smtp_sender.go, SendRegistrationReceivedNotification / SendPurchaseApprovalRequest subject construction). However, issue #401 explicitly identifies a second sink that the PR does not touch:
internal/email/templates.go (around line 808) / internal/email/sender.go SES path builds the same CUDly - New Account Registration: %s (%s) subject with the same fmt.Sprintf pattern and passes it directly to the SES API with no sanitizeHeader call.
Per issue #401, the SES path is the more dangerous of the two: sanitizeHeader is only invoked in the SMTP path, so a CR+LF in the attacker-controlled account_name (from the unauthenticated POST /api/register endpoint) reaches SES unstripped. The SMTP fix in #523 leaves this open.
Discovered while auditing PR #523 (which closes #401).
PR #523 wraps
data.AccountNameanddata.ProviderinsanitizeHeader()in the SMTP path (internal/email/smtp_sender.go, SendRegistrationReceivedNotification / SendPurchaseApprovalRequest subject construction). However, issue #401 explicitly identifies a second sink that the PR does not touch:internal/email/templates.go(around line 808) /internal/email/sender.goSES path builds the sameCUDly - New Account Registration: %s (%s)subject with the samefmt.Sprintfpattern and passes it directly to the SES API with nosanitizeHeadercall.Per issue #401, the SES path is the more dangerous of the two:
sanitizeHeaderis only invoked in the SMTP path, so a CR+LF in the attacker-controlledaccount_name(from the unauthenticated POST /api/register endpoint) reaches SES unstripped. The SMTP fix in #523 leaves this open.Remediation
sanitizeHeader()to AccountName and Provider in the SES subject construction (templates.go / sender.go), mirroring the sec(email): set TLS 1.2 minimum on SMTP StartTLS and sanitize registration subject #523 SMTP fix.account_nameinvalidateRegistrationRequest(internal/api/handler_registrations.go), as issue sec(email): registration notification subject built from unsanitized AccountName — SMTP header injection #401 suggested.Acceptance