Summary
CVE-2026-81730 is a path traversal vulnerability in Dolibarr ERP/CRM’s EmailCollector module, rated HIGH severity. It stems from insufficient sanitization of email attachment filenames when the application saves inbound mail attachments, allowing an attacker to write files outside the intended attachment directory. Any Dolibarr instance configured to fetch mail via EmailCollector from a mailbox reachable by external senders is exposed.
Technical details
- Root cause: the
saveAttachment()logic inhtdocs/emailcollector/lib/emailcollector.lib.php(andemailcollector.class.php) builds the destination file path by directly concatenating the attachment filename taken from the email’s MIME headers, without stripping directory traversal sequences (e.g.../). - Trigger condition: EmailCollector must be configured to retrieve messages from a mailbox that can receive mail from an untrusted sender; the attacker sends an email with a crafted attachment filename.
- Attack vector: Network — no authentication to the Dolibarr application itself is required, only the ability to deliver an email to the monitored mailbox.
- Impact: files can be written outside the intended attachment storage location; if the web root (
htdocs) is writable by the process, this can lead to placement of web-executable content and potential remote code execution. At minimum it enables unauthorized file writes/overwrites.
Affected software
- Dolibarr ERP/CRM versions 9.0.0 through 23.0.4 (EmailCollector module enabled)
- Fixed in Dolibarr 24.0.0, which applies
dol_sanitizePathName()anddol_sanitizeFileName()to attachment filenames
Severity
- CVSS v3.1 Base Score: 8.2 (HIGH)
- Vector:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:L
Mitigation and recommended actions
- Immediate: Upgrade Dolibarr to version 24.0.0 or later, which sanitizes attachment filenames before writing them to disk.
- If immediate patching is not possible:
- Disable the EmailCollector module, or disable any collector jobs configured to fetch attachments from mailboxes that accept mail from untrusted/external senders.
- Ensure the web server user cannot write to web-executable directories (
htdocs) to limit the impact of any file write. - Restrict which mailboxes are polled by EmailCollector to trusted, internal senders only until patched.

