Axis network cameras — 1 vulnerability check

noctis ships 1 vulnerability check for Axis network cameras, covering 7 CVEs; each one has to observe the bug on the live service before it reports a finding.

← All products · Feeds on GitHub

Axis Network Camera .srv Authorization Bypass (CVE-2018-10661 chain)

CVECVE-2018-10658, CVE-2018-10659, CVE-2018-10660, CVE-2018-10661, CVE-2018-10662, CVE-2018-10663, CVE-2018-10664
Severitycritical · CVSS 9.8
Categoryauth-bypass — Auth bypass
Serviceshttp, https
Detectionset_var, script, tcp_connect, match · highest QoD 75
Feedtests/vulnerabilities/axis-camera/axis-camera-srv-auth-bypass.yaml

Axis network cameras (390+ models, firmware before the June 2018 fixes) treat `/index.html/<x>.srv` as a request for the world-readable index.html while also dispatching it to the root `.srv` handler (/bin/ssid). An unauthenticated attacker reaches ssid, then chains dbus-as-root and the parhand shell injection to run commands as root. The feed proves the bypass with an inert `action=test` request whose per-run `return_page` must come back as a 303 redirect, and checks that the same request without the world-readable prefix is not redirected.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. Raw TCP (TLS on HTTPS), sent verbatim: POST /index.html/NOCTIS_TEST.srv HTTP/1.0
  3. Raw TCP (TLS on HTTPS), sent verbatim: POST /{{s.ctl_dir}}/NOCTIS_TEST.srv HTTP/1.0
  4. Parses / computes the next value with a Rhai script
  5. Checks bp.banner for (?i)^HTTP/1\.[01] 303 → finding QoD 75: Axis .srv authorization bypass confirmed: unauthenticated POST /index.html/NOCTIS_TEST.srv (action=test&return_page=…) was handled by the r…

References:

Feed source — tests/vulnerabilities/axis-camera/axis-camera-srv-auth-bypass.yaml
# Axis network cameras (VDOO, June 2018) — `.srv` authorization bypass that
# reaches the root /bin/ssid handler without credentials (CVE-2018-10661),
# the entry point of the CVE-2018-10658..10664 chain (dbus as root,
# parhand shell injection → unauthenticated RCE).
#
# Ported from OpenVAS/Greenbone NVT
# `2018/axis/gb_axis_network_camera_mult_vuln_june18.nasl`
# (OID 1.3.6.1.4.1.25623.1.0.813446, GPL-2.0-only). The NVT fingerprints the
# Axis home page, then sends
#   POST /index.html/VT_TEST.srv   action=test&return_page=VT_Vulnerability_Test
# and flags a `303` whose `Location:` is `VT_Vulnerability_Test`.
#
# The bug: the web server's authorization code sees `/index.html/x.srv` as a
# request for the world-readable `index.html` and lets it through, while the
# `.srv` handler (/bin/ssid, running as root) processes it too. ssid answers
# any action with a 303 to the caller-supplied `return_page`, so getting that
# redirect back without credentials proves the privileged handler was reached.
# Fixed firmware asks for credentials (401) on the same request.
#
# Detection — benign real-exploitation proof (QoD 75):
#   the NASL request with a per-run `return_page` marker. `action=test` is not
#   a real ssid action: nothing is read, written or invoked (no dbus call, no
#   parhand parameter), ssid only redirects.
#   The marker may come back in a relative or absolute Location (proxy).
#
# Better than the NASL:
#   * Per-run marker instead of the static `VT_Vulnerability_Test`, so the
#     proof is unique to this scan.
#   * No home-page fingerprint gate: a camera whose `/` was customised, or sits
#     behind a reverse proxy, is still covered.
#   * Instead of the fingerprint, a control request to `/<random>/x.srv` (no
#     world-readable prefix) must NOT come back with the same redirect: a
#     generic page that 303s to any `return_page` is not reported, and the
#     finding proves the bypass itself, not just an open handler.
#
# Requests go through `tcp_connect` (raw HTTP/1.0) so the 303 is read as is,
# never followed by the HTTP client.
uid: c2641ee3-2c1e-4ff7-8f1e-552127ba96b5
name: "Axis Network Camera .srv Authorization Bypass (CVE-2018-10661 chain)"
description: |
  Axis network cameras (390+ models, firmware before the June 2018 fixes)
  treat `/index.html/<x>.srv` as a request for the world-readable index.html
  while also dispatching it to the root `.srv` handler (/bin/ssid). An
  unauthenticated attacker reaches ssid, then chains dbus-as-root and the
  parhand shell injection to run commands as root. The feed proves the bypass
  with an inert `action=test` request whose per-run `return_page` must come
  back as a 303 redirect, and checks that the same request without the
  world-readable prefix is not redirected.
cves: [CVE-2018-10658, CVE-2018-10659, CVE-2018-10660, CVE-2018-10661, CVE-2018-10662, CVE-2018-10663, CVE-2018-10664]
cvss: 9.8
severity: critical
confidence_base: 0.30
category: auth-bypass
tags: [axis, camera, iot, auth-bypass, unauthenticated]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2018-10661"
  - "https://nvd.nist.gov/vuln/detail/CVE-2018-10662"
  - "https://nvd.nist.gov/vuln/detail/CVE-2018-10660"
  - "https://nvd.nist.gov/vuln/detail/CVE-2018-10658"
  - "https://nvd.nist.gov/vuln/detail/CVE-2018-10659"
  - "https://nvd.nist.gov/vuln/detail/CVE-2018-10663"
  - "https://nvd.nist.gov/vuln/detail/CVE-2018-10664"
  - "https://www.axis.com/files/faq/Advisory_ACV-128401.pdf"

steps:
  # ── Pre-init everything a later condition reads ────────────────────────────
  - id: init-bp
    action: set_var
    var_name: bp
    var_value: {connected: false, banner: null}

  - id: init-ctl
    action: set_var
    var_name: ctl
    var_value: {connected: false, banner: null}

  # ── Per-run marker, control path and request body ──────────────────────────
  - id: gen
    action: script
    store_as: s
    code: |
      let marker = "NOCTIS" + rand_hex(8);
      let body = "action=test&return_page=" + marker;
      #{
        marker: marker,
        ctl_dir: "noctis" + rand_hex(6),
        body: body,
        len: strlen(body).to_string()
      }

  # ── Exploit: world-readable prefix + .srv suffix, no credentials ───────────
  - id: bypass
    action: tcp_connect
    port: "{{port}}"
    timeout_secs: 10
    send: "POST /index.html/NOCTIS_TEST.srv HTTP/1.0\r\nHost: {{target_host}}\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-Length: {{s.len}}\r\nConnection: close\r\n\r\n{{s.body}}"
    store_as: bp

  # ── Control: same request without a world-readable prefix ─────────────────
  - id: control
    action: tcp_connect
    port: "{{port}}"
    timeout_secs: 10
    send: "POST /{{s.ctl_dir}}/NOCTIS_TEST.srv HTTP/1.0\r\nHost: {{target_host}}\r\nContent-Type: application/x-www-form-urlencoded\r\nContent-Length: {{s.len}}\r\nConnection: close\r\n\r\n{{s.body}}"
    store_as: ctl

  - id: verdict
    action: script
    store_as: v
    code: |
      fn redirected(r, marker) {
        if r.connected != true || type_of(r.banner) != "string" { return false; }
        let b = tolower(r.banner);
        ereg("^http/1\\.[01] 303", b) && ereg("\nlocation:[ \t]*[^\r\n]*" + tolower(marker), b)
      }
      let hit = redirected(bp, s.marker);
      let ctl_hit = redirected(ctl, s.marker);
      #{ bypass: hit && !ctl_hit }

  # 303 to our marker only through the world-readable prefix = ssid reached
  # without credentials.
  - id: confirm-bypass
    action: match
    source: bp.banner
    pattern: "(?i)^HTTP/1\\.[01] 303"
    condition: "v.bypass == true"
    on_match:
      finding:
        confidence_delta: 0.55
        qod: 75
        evidence: "Axis .srv authorization bypass confirmed: unauthenticated POST /index.html/NOCTIS_TEST.srv (action=test&return_page={{s.marker}}) was handled by the root .srv handler and answered 303 Location: {{s.marker}}, while the same request to /{{s.ctl_dir}}/NOCTIS_TEST.srv was not"

View these feeds on GitHub