/

CVE-2026-40569

Severity:

CRITICAL RISK

(9.0)

Mass Assignment / Authorization Misconfiguration

CVE-2026-40569

Deferred

Vulnerability type

Category:

Mass Assignment / Authorization Misconfiguration

CWE:

CWE-284, CWE-915

Impact:

Privilege Abuse and Persistent Data Exfiltration via Mass Assignment

Severity:

CRITICAL RISK

(9.0)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

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() and connectionOutgoingSave() 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() and connectionOutgoingSave()).
  • 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 $fillable array 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_bcc field.
  • 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, or out_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_enabled and auto_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 $fillable arrays.
  • 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.

Sources

SourceLink
github.comgithub.com/freescout-help-desk/freescout/commit/f45b9105d43b0352c08fcca154e8ae6177c3d860
github.comgithub.com/freescout-help-desk/freescout/releases/tag/1.8.213
github.comgithub.com/freescout-help-desk/freescout/security/advisories/GHSA-hmqm-33wp-858j

Frequently asked

questions

Yes, but only via authenticated access. Any attacker who can obtain or abuse an admin account with permission to modify mailbox connection settings can exploit the vulnerability over standard HTTP/HTTPS, without needing shell access or direct database access.

The attacker must act as an authenticated administrator capable of accessing the mailbox connection settings pages. This could be a malicious insider, a compromised admin account, or an attacker leveraging another vulnerability (such as XSS or credential theft) to hijack an admin session.

Replace generic model population ($request->all() into fill() or similar) with explicit, per-endpoint allowlists that enumerate allowed fields. Combine this with robust validation that rejects unexpected parameters, and separate the handling of general mailbox attributes from connection-specific settings so that each endpoint only touches fields relevant to its purpose.

Adopt a standard practice that no controller may assign request data to a model without first whitelisting fields. Enforce this through coding guidelines, framework-level helpers, and automated checks (SAST/linters). Additionally, treat configuration and security-sensitive fields as high risk, subject them to separate update flows, and ensure that all such changes are logged and periodically reviewed.

Find out what's already
exploitable in your codebase.