Summary
FreeScout's reply and draft handling logic previously trusted client-supplied encrypted attachment IDs without re-checking whether the caller was authorized to operate on those attachments.
A mailbox peer who can view a conversation could replay attachment IDs through the draft-saving API to trigger deletion of attachment records and files belonging to that conversation.
Affected context
This vulnerability arises in FreeScout's reply and draft flows for conversations in shared mailboxes.
It affects scenarios where:
- Multiple users share access to the same mailbox or conversation
- The UI exposes encrypted attachment IDs through the
load_attachmentsmechanism - The server-side logic accepts
attachments_all[]from the client as trusted identifiers and processes deletions without per-attachment authorization checks
The issue does not inherently allow access to arbitrary mailboxes, but it weakens integrity controls for attachments within conversations that a user can already view.
Exploit preconditions
- Attack surface: Application HTTP endpoints handling
save_draft/ reply flows in FreeScout. - Required access: Authenticated access to a shared mailbox conversation where the attacker is a mailbox peer (i.e., can legitimately view the conversation and its attachments).
- Necessary information: Encrypted attachment IDs returned by
load_attachmentsfor that conversation. - Trigger point: Submission of crafted
attachments_all[]input omitting certain IDs from the retained lists so that they are treated as deletable. - Why exploitation is possible: The server logic assumes that encrypted attachment IDs supplied by the client are implicitly authorized and does not revalidate ownership or permissions per attachment before calling
Attachment::deleteByIds().
Why this happens
The core issue maps to CWE-862: Missing Authorization, where access control checks are missing for a particular operation.
In this case, the application:
- Treats encrypted attachment IDs as a sufficient proof of authorization instead of a mere identifier.
- Relies on the client to indicate which attachments are retained or deleted without independently verifying the user's rights for each attachment ID.
- Directly decrypts and passes these IDs to
Attachment::deleteByIds()without enforcing per-attachment permission checks or verifying that the requester is the owner or an authorized operator for the deletion action.
This design conflates confidentiality (hiding IDs behind encryption) with authorization, leading to insecure reliance on client-controlled input for destructive operations.
Potential impact
- Mailbox peers may delete attachments from conversations they can view, beyond what the UI intends to allow.
- Integrity of help desk records can be compromised by silently removing attached files and their associated database rows.
- Auditability and evidence in customer support threads can be weakened due to missing file artifacts.
- Workflows or external processes relying on persisted attachments can be disrupted.
General mitigation guidance
Mitigation typically focuses on enforcing strict, server-side authorization and reducing trust in client-supplied identifiers:
- Perform explicit authorization checks for every sensitive operation, such as deletion, using server-side context (user identity, mailbox membership, conversation ownership).
- Treat encrypted or obfuscated IDs as opaque identifiers only; never as proof of permission.
- Implement a server-driven model where the backend determines which attachments are eligible for deletion based on the current user and conversation, rather than trusting client lists.
- Enforce least-privilege policies so that users can only modify or delete attachments they are intended to manage.
- Introduce centralized access control layers for attachment operations to ensure consistent enforcement across reply, draft, and other flows.
How teams detect issues like this
Organizations can look for this class of issue using both code-level and behavioral approaches:
- Static analysis / code review:
- Identify controller or service methods that call destructive APIs like
Attachment::deleteByIds()and verify that they are preceded by explicit authorization checks. - Flag patterns where encrypted or tokenized IDs from request parameters (e.g.,
attachments_all[]) are decrypted and used directly without validating ownership or permissions. - Review access control logic to ensure it is not delegated to client-side filtering or UI controls.
- Dynamic / runtime monitoring:
- Log attachment deletion events with user identifiers and conversation IDs, and review for anomalous patterns (e.g., frequent deletions by non-owner accounts).
- Set up policy-based checks that compare deletions against expected user roles within a mailbox.
- Automated tooling:
- Use application security testing tools (SAST/DAST) configured to detect missing authorization around critical CRUD operations.
- Integrate security-focused code review checks into CI pipelines to enforce consistent access control patterns.

