Self-hosted Zimbra Collaboration servers are a repeat target because a single unauthenticated flaw on an internet-facing mail server hands an attacker every mailbox in the organisation. The CISA Known Exploited Vulnerabilities catalogue lists 19 Synacor Zimbra entries, from the 2022 mailbox import chain to cross-site scripting in calendar invitations and command injection through SMTP. This guide covers how authentication, administration and preauth keys work in Zimbra, which ports and services to expose, the configuration settings Zimbra's own security operations notes recommend, and how to detect compromise. It is for mail administrators and security engineers running Zimbra on premises or in a private cloud. For general email controls such as DMARC and gateway filtering, see the Email Security Guide.
Key takeaways
- Patching speed is the main control. Zimbra does not separate security fixes from feature releases, so every patch release may carry a security fix, and exploited flaws such as CVE-2024-45519 (postjournal, CVSS 9.8) allow unauthenticated command execution.
- The admin console must never face the internet. Keep port 7071 internal, publish 9071 through the proxy only if needed, and reach it over VPN or an SSH tunnel.
- The domain preauth key is a master key. Zimbra's documentation warns that
zimbraPreAuthKeycan generate valid auth tokens for any user in the domain, so treat it as a privileged non-human credential. - Two-factor authentication needs Network Edition and careful options. Enforce it per Class of Service, disable trusted devices and manage application passcodes for IMAP and ActiveSync clients.
- Logs only help if they show the real client IP. Configure
zimbraMailTrustedIPand the originating IP header, and shipaudit.logandmailbox.logoff the server.
How identity and access work in Zimbra
Zimbra stores accounts, domains, Classes of Service (CoS) and server configuration in its own OpenLDAP directory (port 389, internal only). Users sign in to the web client over HTTPS through the Zimbra proxy (nginx), or connect with IMAP, POP3, SMTP submission and ActiveSync. Authentication can be local, or delegated to an external LDAP or Active Directory per domain.
| Mechanism | What it does | Hardening setting |
|---|---|---|
| Password sign-in | Local or external LDAP/AD authentication per domain | When using external auth, set zimbraAuthFallbackToLocal FALSE on the domain so a local password cannot bypass the directory |
| Alias login | Sign in with an alias address | zmlocalconfig -e alias_login_enabled=false to reduce guessable login names |
| Two-factor authentication | TOTP second factor, Network Edition only (since 8.7) | CoS > Advanced > Two Factor Authentication: require setup for all users |
| Trusted devices | "Trust this computer" skips the second factor | zmprov mc default zimbraFeatureTrustedDevicesEnabled FALSE |
| Application passcodes | Per-client passwords for IMAP, ActiveSync and others that cannot do TOTP | Allow only where needed; a password change revokes them all |
| Auth tokens and sessions | Web and admin session lifetime | Review zimbraAuthTokenLifetime, zimbraAdminAuthTokenLifetime and zimbraMailIdleSessionTimeout |
| Preauth | A trusted system vouches for a user using a shared domain key | Generate only when needed; vault the key; see below |
Two web settings from Zimbra's security operations notes also reduce session theft risk (ATT&CK T1550.004 Web Session Cookie): zmlocalconfig -e zimbra_same_site_cookie="Strict", and zimbraReverseProxyStrictServerNameEnabled TRUE with zimbraVirtualHostName set on each domain so the proxy rejects unexpected Host headers.
The webmail client is itself an attack surface. Several KEV entries are cross-site scripting flaws, including CVE-2025-27915 in the Classic Web Client, where JavaScript embedded in an ICS calendar entry runs when the user views the message. Attacker script running in a logged-in session acts with the user's rights without needing the password, which is why patching the web client matters as much as patching the server.
Admin roles and privileged access
Zimbra has global administrators, who can change anything in the deployment, and delegated administrators, who are granted specific rights over domains or accounts. The admin console and admin SOAP API run on the mailbox server at port 7071, and the proxy can publish them on 9071.
- Keep the admin UI off the internet: Zimbra's notes say not to expose 7071 or 9071 publicly. Use a VPN or an SSH tunnel such as
ssh -L 7071:localhost:7071with a low-privilege SSH user, or proxy the console on 9071 with stronger TLS and firewall 7071. - Separate admin identities: administrators should use a dedicated admin account with a strong password and two-factor authentication, not their mailbox account. Disable stale admin accounts and consider keeping the built-in admin account disabled except when needed.
- Prefer delegated admin for help desks: password resets and mailbox moves rarely need global rights. Review who holds global admin each quarter.
- Protect the operating system account: the
zimbraUnix user runs every service, and successful exploits such as CVE-2026-73570 execute commands as that user. Restrict SSH to known IP addresses, disable password authentication (PasswordAuthentication no) and log allsudouse. - Admin preauth is stronger still: preauth supports an admin mode (
admin=1), so a leaked domain key may reach admin sessions as well as user sessions.
Small deployments with one or two administrators usually get most value from VPN-only console access plus 2FA. Larger providers and universities with many domains should invest in delegated admin, per-domain rights and a privileged access workflow. See the Privileged Access Management Guide.
Integrations, API tokens and service accounts
Zimbra servers hold several credentials that are not tied to a person. Each one is a non-human identity with an owner, a storage location and a rotation plan, or it becomes the path an attacker uses to persist.
| Credential | Where it lives | Risk | Control |
|---|---|---|---|
Domain preauth key (zimbraPreAuthKey) | Domain attribute, plus every portal or SSO system that uses it | Forge sign-in for any user in the domain (T1606 Forge Web Credentials) | Only generate if a portal needs it; store in a vault; regenerate after any server or portal compromise |
| External LDAP/AD bind account | Domain auth configuration | Directory read access, credential reuse | Read-only bind account, LDAPS, rotate on schedule |
| Application passcodes | User accounts | Bypass 2FA for IMAP or ActiveSync | Review count per user; revoke on offboarding |
| Internal LDAP and service passwords | zmlocalconfig on each node | Full directory control if read from disk | Restrict filesystem access to the zimbra user and root; rotate after compromise |
| Backup and archiving credentials | Backup jobs, archive integrations | Bulk mailbox export | Scope to backup only; store outside the mail server |
| JWT signing secret | Server configuration | Token forgery; CVE-2026-73576 covered weak random generation for this secret, fixed in 10.1.17 | Patch, then rotate secrets after the update |
Zimbra's preauth documentation adds three operational warnings: its sample code hard-codes keys, which is unsafe in production; preauth via REST does not log the user's originating IP without extra SOAP configuration; and since 9.0.0 Patch 30 and 8.8.15 Patch 37 preauth redirects only to zimbraPublicServiceHostname. See the Secrets Management Guide for vaulting and rotation patterns.
Also lock down server features that can be abused to reach other systems. Zimbra's notes recommend zmprov mc default zimbraProxyAllowedDomains "" so the proxy servlet cannot fetch arbitrary URLs, which matters because KEV includes Zimbra server-side request forgery flaws (CVE-2019-9621, CVE-2020-7796).
Logging and detection
Zimbra writes runtime logs under /opt/zimbra/log/. Forward them to a central log server, because an attacker with code execution as the zimbra user can edit local logs. With rsyslog, audit.log can be forwarded under the tag zimbra-audit:.
| Log | Records | Look for |
|---|---|---|
/opt/zimbra/log/audit.log | Authentication | Password spraying (T1110.003), admin sign-ins from new addresses, preauth use |
/opt/zimbra/log/mailbox.log | Mailbox service, SOAP requests; oip= and ua= fields once trusted proxies are set | Mailbox export or import requests, unusual SOAP admin calls, forwarding rule changes |
/opt/zimbra/log/nginx.access.log | Proxy access | Requests to import servlets and unusual paths, scanning from single sources |
/opt/zimbra/log/sync.log | ActiveSync | New devices on privileged mailboxes |
/var/log/zimbra.log | Postfix and amavisd | Malformed SMTP commands, outbound spam bursts from compromised accounts |
/var/log/audit/audit.log (auditd) | Operating system events | New files under web application directories, shells spawned by Java or Postfix processes (T1505.003, T1059.004) |
- Get the real client IP: set
zimbra_http_originating_ip_headertoX-Forwarded-Forand add the loopback and proxy addresses withzmprov mcf +zimbraMailTrustedIP. Without it, every request appears to come from the proxy. - Track last logon:
zimbraLastLogonTimestampFrequencycontrols how often last logon is recorded; a short interval helps find dormant accounts that suddenly sign in. - File integrity: use Zimbra's integrity check script to checksum installation files and find unexpected changes, a common sign of a web shell after exploitation.
- Debug only when needed:
zmprov addAccountLogger <user> zimbra.soap debuggives per-account detail during an investigation; remove it afterwards.
If you find an unexpected JSP file or shell process, follow the Web Shell Response Playbook, then rotate the preauth key, LDAP passwords and admin credentials, because code execution as zimbra exposes all of them.
Metrics
- Days from a Zimbra security patch release to deployment on every node (target within your critical-patch window for KEV-listed issues).
- Number of internet-reachable ports per node compared with the approved list.
- Percentage of active accounts with 2FA enrolled, and number of application passcodes per user.
- Number of accounts holding global admin, and admin sign-ins from outside the management network (target zero).
- Integrity check exceptions per month and time to explain each one.
Hardening baseline
Network exposure
| Port | Service | Exposure |
|---|---|---|
| 25, 465, 587 | SMTP inbound, SMTPS, submission | External as required; rate-limit and protect SMTP auth with fail2ban |
| 443 | Web client via proxy | External |
| 993, 995 | IMAPS, POP3S | External only if clients need them; prefer no plaintext 110 and 143 |
| 9071 | Admin console via proxy | Management network only |
| 7071 | Admin console on mailbox server | Internal only, firewall from everything except the proxy and tunnels |
| 389 | LDAP | Internal between Zimbra nodes |
| 7025, 7110, 7143, 7993, 7995, 8443 | LMTP and backend mail and HTTPS | Internal only |
| 8465, 10024-10032 | OpenDKIM, amavisd, Postfix and policy services | Localhost only |
Use a host firewall that fails closed (Zimbra's notes give an iptables example and caution that firewalld can leave ports open if it fails), mirror the rules for IPv6, and restrict SSH to known addresses. For network-level patterns see the Network Device Management Plane Hardening Guide.
Configuration settings
- Relay control: set
zimbraMtaMyNetworksto loopback and the networks that genuinely relay, never a wide range. - Header hygiene:
zmprov mcf zimbraSmtpSendAddMailer FALSEto stop advertising the mailer version. - Crawlers:
zimbraMailKeepOutWebCrawlers TRUEand anX-Robots-Tag: noindexresponse header. - Attachments: keep
zimbraMtaBlockedExtensionpopulated (for example exe, bat, vbs) with warnings to admin and recipient. - Attachment scanning dependency: install
paxso Amavis does not fall back tocpio; CVE-2022-41352 abused cpio to upload arbitrary files. - Kernel and supported versions: run a supported OS and Zimbra line. Zimbra's advisory page lists fixes for 10.1.x, 10.0.x, 9.0.0 and 8.8.15 patch lines; anything older is unpatched for current flaws.
Patching and rollout
- Subscribe: follow the Zimbra security advisory RSS feed and the CISA KEV catalogue for Synacor entries.
- Set a severity clock: Zimbra's own example policy is immediate or end of business day for high-rated fixes, end of the working week for medium and a monthly window for low. KEV-listed or unauthenticated remote code execution flaws belong in the fastest lane. See the Emergency Out-of-Band Patching Playbook.
- Snapshot and test: snapshot the VM or back up
/opt/zimbraand LDAP, then patch a staging node and test web sign-in, 2FA, ActiveSync and mail flow. - Patch every node: follow the node order and steps in the release notes for your patch line (Zimbra advises reviewing them because security and feature changes ship together), and reboot after kernel updates.
- Roll back: revert the snapshot if mail flow fails, keeping the node off the internet until the fix can be retried.
- Hunt after emergency patches: for exploited flaws, check for web shells and new admin accounts on every node, because patching does not remove an attacker who arrived first.
Framework mapping
| Area | NIST SP 800-53 Rev. 5 | NIST CSF 2.0 | MITRE ATT&CK |
|---|---|---|---|
| Patching and vulnerability monitoring | SI-2, RA-5 | ID.RA-01, PR.PS-02 | T1190 |
| Admin console exposure | AC-17, SC-7, AC-6 | PR.AA-05 | T1190 |
| User authentication and 2FA | IA-2, IA-5 | PR.AA-05 | T1110.003, T1114.002 |
| Preauth key and service credentials | IA-5 | PR.AA-05 | T1606 |
| Configuration baseline | CM-6 | PR.PS-01 | T1566.002 |
| Central logging | AU-9 | DE.CM-01 | T1505.003 |
Common misconfigurations
- Admin console reachable from the internet: exposing 7071 or 9071 turns every admin authentication flaw into an internet-facing one. Firewall them first, before anything else on this page.
- Falling behind on patch lines: unsupported versions share the flaws of supported ones but get no fixes. The 2022 chain of CVE-2022-37042 (authentication bypass in MailboxImportServlet) and CVE-2022-27925 (mboximport file upload) gave unauthenticated code execution on unpatched servers.
- Preauth keys left in portal code: a key copied into a web portal's source or configuration repository can sign in as anyone in the domain, and REST preauth does not log the originating IP.
- 2FA with trusted devices left on: a "trusted" browser skips the second factor, so a stolen password plus a reused device defeats 2FA. Disable trusted devices in every CoS.
- No real client IPs in logs: without
zimbraMailTrustedIP, investigators see only the proxy address and cannot scope spraying or session theft. - Assuming a patch ends the incident: exploitation of mail servers is often found weeks later. After a KEV-listed Zimbra flaw, hunt for web shells, new admin accounts and mail forwarding rules even if you patched quickly.
Practitioner checklist
- Firewall 7071 and 9071 from the internet and reach the admin console only through VPN or an SSH tunnel.
- Confirm every node runs a supported Zimbra patch line and subscribe to the advisory feed and KEV.
- Apply the port table: only 25, 443, 465, 587 and required IMAPS or POP3S externally; LDAP and backend ports internal.
- Enforce 2FA through CoS, disable trusted devices and review application passcodes.
- Set
zimbraAuthFallbackToLocal FALSEon externally authenticated domains and disable alias login. - Inventory every
zimbraPreAuthKey, move keys into a vault and regenerate any found in code or tickets. - Configure
zimbraMailTrustedIPand the originating IP header, and forwardaudit.log,mailbox.logand nginx logs centrally. - Run the integrity check after each patch and investigate every unexpected change.
- Install
pax, set strict SameSite cookies and strict server name checking on the proxy. - Rehearse the web shell and credential rotation steps for a Zimbra compromise.
Standards and references
- Zimbra: Security Advisories
- Zimbra: Security Operations Tips
- Zimbra: Preauth
- Zimbra: Ports
- Zimbra: Two-factor authentication
- Zimbra: Log Files
- CISA: Known Exploited Vulnerabilities Catalog
- NIST: SP 800-53 Rev. 5
Related NHI Mgmt Group resources: Email Security Guide · Web Shell Response Playbook · Emergency Out-of-Band Patching Playbook · Secrets Management Guide