harden(messages): SSRF guard on mailbox host, strict sandbox + sanitizer, per-account TLS
Pre-upstream review hardening: - /accounts + /accounts/test now reject private/internal IMAP/SMTP hosts via isPrivateIP(), matching /config + /incoming-config (SSRF). - QueueDetail body iframe uses sandbox="" (script-less, no same-origin) like the inbound pane, instead of allow-same-origin. - /send sanitizer drops the <style> tag + data: scheme to match the stricter inbound sanitizeBody allowlist. - Per-account SMTP transport sets tls.rejectUnauthorized explicitly.
This commit is contained in:
@@ -798,6 +798,7 @@ async function sendRawEmail({ to, cc, subject, html, text, attachments, accountK
|
||||
port: parseInt(acct.smtp_port, 10) || 587,
|
||||
secure: acct.smtp_secure === true || acct.smtp_secure === 1,
|
||||
auth: acct.smtp_user && acct.smtp_pass ? { user: acct.smtp_user, pass: acct.smtp_pass } : undefined,
|
||||
tls: { rejectUnauthorized: true },
|
||||
});
|
||||
fromEmail = acct.from_email || acct.smtp_user;
|
||||
fromName = acct.from_name || '';
|
||||
|
||||
Reference in New Issue
Block a user