Summary
FreeScout mailbox connection settings endpoints suffer from a mass assignment vulnerability that allows arbitrary modification of mailbox properties via $request->all() passed directly into $mailbox->fill() without proper allowlisting.
An authenticated admin can inject hidden parameters into a legitimate connection settings request to silently alter security-sensitive fields such as auto_bcc, out_server, signature, and auto-reply behavior, enabling persistent email exfiltration, phishing, or traffic redirection without obvious UI indicators.
Affected context
The vulnerability occurs in FreeScout deployments where:
- Mailbox connection settings are updated via the
connectionIncomingSave()andconnectionOutgoingSave()endpoints. - Controller methods pass
$request->all()directly to$mailbox->fill()without an explicit allowlist of permitted fields for these specific forms. - Validation is absent or only checks formats for expected fields, without rejecting or stripping unexpected parameters.
- Multiple administrators share mailbox management responsibilities, or where admin sessions might be at risk from other issues (e.g., XSS or credential theft).
In these conditions, a malicious or compromised admin account can manipulate mailbox properties that are not exposed in the connection settings UI.
Exploit preconditions
- Attack surface: Application HTTP endpoints handling mailbox connection settings (
connectionIncomingSave()andconnectionOutgoingSave()). - Required access: An authenticated admin account with permission to manage mailbox connection settings; this may be a malicious insider or an attacker who has compromised an admin session.
- Trigger point: Submitting a connection settings update request with additional parameters beyond those present in the normal form, such as
auto_bcc,signature,auto_reply_enabled, or overridden SMTP fields. - Why exploitation is possible: The controller methods:
- Accept all request parameters via
$request->all(). - Pass them directly into
$mailbox->fill()relying solely on the model's$fillablearray instead of a per-endpoint allowlist. - Include no effective validation to strip or reject unexpected fields.
This combination allows any fillable field on the Mailbox model to be overwritten from a single request, even if it does not belong to the current form.
Why this happens
The core issue is a mass assignment design flaw where the controller trusts all incoming request data for model population.
Instead of constructing a scoped, explicit list of allowed fields for the connection settings forms, both connectionIncomingSave() and connectionOutgoingSave() call $mailbox->fill($request->all()). The Mailbox model declares a broad $fillable array (32 fields), which includes security-sensitive properties like auto_bcc, outbound SMTP details, signature content, and auto-reply flags and templates.
Because validation is either commented out (connectionIncomingSave()) or limited to format checking for SMTP-related fields (connectionOutgoingSave()), the application never enforces a boundary between "fields editable via this form" and "fields that must not be controlled here". This maps to:
- CWE-915: Improperly Controlled Modification of Dynamically-Determined Object Attributes (Mass Assignment) – arbitrary attributes are set based on client-controlled input.
- CWE-284: Improper Access Control – the endpoint effectively grants broader modification privileges than intended for the specific operation, enabling unauthorized manipulation of sensitive configuration and content.
Potential impact
- Silent BCC exfiltration: every outgoing email from a mailbox may be automatically BCC'd to an attacker-controlled address via the
auto_bccfield. - Covert monitoring of customer communication, including sensitive support conversations and PII.
- Redirection of outbound SMTP traffic through attacker-controlled servers by altering
out_server,out_port,out_username, orout_password. - Injection of malicious or tracking content into email signatures (e.g., tracking pixels, phishing links, or disinformation).
- Malicious auto-replies that can mislead customers, harvest credentials, or spread phishing campaigns via
auto_reply_enabledandauto_reply_message. - Persistent surveillance that survives password changes or session expiry, as the modified mailbox configuration remains active until noticed and reverted.
- Increased insider threat impact in multi-admin environments, where one admin can invisibly surveil mailboxes managed by others.
General mitigation guidance
Effective mitigation focuses on tightening data binding and access control at the controller and model levels, and on reducing attack surface for configuration changes:
- Per-endpoint allowlists: For each form or endpoint, explicitly define the set of fields that are permitted to be updated, and pass only these to the model (e.g.,
$request->only([...])or equivalent). Avoid using$request->all()for model population. - Context-aware binding: Separate "connection settings" from "general mailbox settings" into distinct update routines, each with its own validated field set, so that connection-related actions can never alter general or security-sensitive attributes.
- Stricter validation and filtering: Implement validation that not only checks formats but also rejects unexpected fields, failing fast when unknown parameters are supplied.
- Least-privilege administration: Consider more granular roles (e.g., "connection settings manager" vs "mailbox policy owner") so that not all admins can modify high-impact fields like BCC, signatures, or auto-replies.
- Secure defaults for sensitive fields: Treat fields such as BCC targets, SMTP credentials, and automated messaging as high-risk and require explicit, auditable workflows or separate screens/endpoints to change them.
- Audit and visibility: Ensure that changes to critical mailbox attributes are logged and easily reviewable, helping detect misuse even if it occurs.
How teams detect issues like this
Detection can rely on both code-centric and behavior-centric approaches:
- Static code analysis:
- Search for controller actions calling
$model->fill($request->all())or equivalent patterns where broad request data is mapped to models with large$fillablearrays. - Flag endpoints that accept arbitrary input and write directly to configuration or security-sensitive models without explicit allowlists.
- Use SAST tools or custom rules for frameworks like Laravel to detect mass assignment anti-patterns and absent validation.
- Code review practices:
- During reviews, scrutinize any controller method that updates models based on request input; verify that only intended fields are writable in each context.
- Require reviewers to confirm that validation logic both checks value correctness and enforces a strict field set.
- Runtime and operational monitoring:
- Log changes to mailbox configuration fields, especially
auto_bcc, SMTP settings, signature content, and auto-reply fields. - Set up alerts for unusual changes (e.g., BCC addresses pointing outside trusted domains, sudden SMTP server changes, or large-scale modifications to signatures/auto-replies).
- Periodically scan configuration data for patterns indicative of exfiltration, phishing, or abuse (e.g., suspicious domains, known tracking infrastructures).
- Security testing:
- Include mass assignment checks in regular penetration tests, attempting to submit extra parameters on configuration forms and verifying whether they impact unrelated model fields.

