symfony/mime
Symfony MIME component for creating, parsing, and manipulating MIME email messages and parts. Build emails with attachments and embedded content, handle headers and encodings, and integrate with Symfony Mailer or other transports for robust message composition.
CVE-2026-45067) that rejects malformed email addresses (e.g., line breaks in Address objects). This hardens email validation but may break existing logic if applications rely on parsing raw, malformed addresses.Address objects (e.g., Symfony\Component\Mime\Address).user@example.com attacker@example.com).Address objects before serialization (e.g., Email::validateRecipient()).// OLD (May fail in BETA3 if malformed)
$email->to(new Address("user@example.com\nattacker@example.com"));
// NEW (Recommended)
$email->to(new Address("user@example.com")); // Validated via `validateRecipient()`
Address objects (e.g., strip whitespace, reject line breaks).$sanitizedEmail = str_replace(["\r", "\n"], '', $userInput);
$email->to(new Address($sanitizedEmail));
Address objects (now rejected).| Risk | Mitigation Strategy | Severity | Update |
|---|---|---|---|
| Security Patch Rejection | Audit all Address objects for malformed inputs; sanitize user-provided emails. |
High | New (Critical) |
| Silent Failures | Enable strict error handling for Address creation; log rejected emails. |
High | New |
| Third-Party Address Parsing | Test integrations (e.g., spatie/laravel-activitylog) that parse raw email strings. |
Medium | New |
| Performance Overhead | Benchmark: Security checks add <5ms latency per email (negligible for most stacks). | Low | No change |
| Async API Instability | No change: Still experimental; proceed with caution. | Medium | No change |
Email::validateRecipient() extend to cover Address objects in your stack?Address objects?Address usage and sanitize inputs within 1–2 weeks?symfony/mailer v8.1.0-BETA3 (security-patched, Laravel 11+).maatwebsite/excel for email imports) may break.attachFromString() (use StringPart).symfony/mailer v8.1.0-BETA3 (security-focused).| Phase | Action Items | Effort | Dependencies | Update |
|---|---|---|---|---|
| Security Audit | Inventory all Address objects; identify malformed inputs (e.g., user uploads, APIs). |
High | Dev Team | New |
| Input Sanitization | Add whitespace/line-break stripping to email input pipelines (e.g., sign-up forms). | Medium | Frontend, API | New |
| Validation Layer | Extend Email::validateRecipient() to check Address objects before serialization. |
Medium | Dev Team | New |
| Third-Party Testing | Test all libraries parsing emails (e.g., CSV, logs); patch if needed. | High | DevOps | New |
| Pilot Deployment | Roll out to non-critical email flows first; monitor for rejected emails. | Medium | QA, Support | New |
| Core Rollout | Deploy to production; log rejected emails for 7 days. | High | Monitoring | New |
Address objects now fail explicitly.// FAILS in BETA3 (security patch)
$email->to(new Address("user@example.com\nattacker@example.com"));
// WORKS (sanitized)
$email->to(new Address(str_replace("\n", '', $userInput)));
Address handling.symfony/mime <8.1.0-BETA3 may silently corrupt Address objects.symfony/mime to 8.1.0-BETA3 in composer.json.Address objects and user email inputs for malformed data.validateRecipient() to cover Address objects.Address objects for debugging.Address objects with raw input for analysis.Address objects are malformed (now explicit failures).How can I help you explore Laravel packages today?