import { describe, it, expect } from 'vitest'; import { buildMdnMessage } from '@/lib/mdn'; // GHSA-w38p-hpqv-g89c: every value that lands in a header of the read receipt // originates with the sender of the message being answered, and Stalwart hands // it back already RFC 2047-decoded. A bare CRLF smuggled inside an encoded-word // used to be interpolated verbatim into the Subject: line, letting the sender // append From/Reply-To/Content-Type headers and a body to a message the // victim's own account files into Sent and submits. const base = { to: 'sender@other.com', fromEmail: 'me@example.com', originalMessageId: 'orig@other.com', }; // The decoded subject from the advisory's proof of concept. const INJECTED_SUBJECT = 'Invoice\r\nFrom: IT Helpdesk \r\nReply-To: attacker@evil.test\r\n' + 'Content-Type: text/html; charset=utf-8\r\n\r\n

Forged