Suse Sdb — 1 vulnerability check

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

← All products · Feeds on GitHub

SuSE sdbsearch.cgi Referer path traversal

CVECVE-2001-1130
Severityhigh · CVSS 7.5
Categoryrce — Remote code execution
Serviceshttp, https
Detectionset_var, http_request, match · highest QoD 75
Feedtests/vulnerabilities/suse-sdb/CVE-2001-1130.yaml

Tests for the SuSE support database search script sdbsearch.cgi, which builds the path of its keyword file from the HTTP Referer header. The feed requests sdbsearch.cgi (under /cgi-bin and the web root) with a Referer containing "/../../../../etc"; a script that answers with the resulting path (htdocs//../../../../etc/keylist.txt) follows the header out of its own directory. A control request with a harmless Referer must not return that path, so a server echoing the same text for every request is not reported. The request only reads; no keyword file is uploaded and no command runs.

How noctis detects it

  1. HTTP(S) request GET {{dir}}/sdbsearch.cgi?stichwort=anything
  2. Checks probe_r.body for htdocs//\.\./\.\./\.\./\.\./etc/keylist\.txt
  3. HTTP(S) request GET {{dir}}/sdbsearch.cgi?stichwort=anything
  4. Checks ctrl_r.body for \.\./\.\./\.\./\.\./etc/keylist\.txt
  5. Checks probe_r.body for htdocs//\.\./\.\./\.\./\.\./etc/keylist\.txt → finding QoD 75: SuSE sdbsearch.cgi follows the Referer header out of its directory (CVE-2001-1130)

References:

Feed source — tests/vulnerabilities/suse-sdb/CVE-2001-1130.yaml
# SuSE sdbsearch.cgi HTTP Referer directory traversal — CVE-2001-1130
#
# sdbsearch.cgi (SuSE Linux 6.0-7.2 support database search) builds the path of
# its keyword list (keylist.txt) from the HTTP Referer header. A ".." in the
# Referer therefore points the script at any directory; an attacker who can put
# a keylist.txt there (filenames with shell metacharacters) gets commands run
# as the web server user.
#
# Detection (benign, read-only, writes nothing): GET <cgi-dir>/sdbsearch.cgi?stichwort=anything
# with "Referer: http://<host>/../../../../etc". A vulnerable script reports the
# path it built from the header ("htdocs//../../../../etc/keylist.txt"), proving
# the Referer steers the file lookup. A control request with an innocuous
# Referer must not carry that text, so a host that reflects headers or answers
# every request alike is not reported. QoD 75 (response analysis): the
# keylist.txt upload that makes it code execution is deliberately not sent.
#
# Improvement over the source NASL: the control request removes the false
# positives of hosts echoing the same text for any request.
#
# NVD scores the CVE under CVSS v2 only (7.5); that score is kept.
#
# Ported from OpenVAS/Greenbone NVT 2008/sdbsearch.nasl (GPL-2.0-only).
uid: 2ffee91b-02e7-4f3d-88aa-3e412903ce48
name: "SuSE sdbsearch.cgi Referer path traversal (CVE-2001-1130)"
description: |
  Tests for the SuSE support database search script sdbsearch.cgi, which
  builds the path of its keyword file from the HTTP Referer header. The feed
  requests sdbsearch.cgi (under /cgi-bin and the web root) with a Referer
  containing "/../../../../etc"; a script that answers with the resulting
  path (htdocs//../../../../etc/keylist.txt) follows the header out of its own
  directory. A control request with a harmless Referer must not return that
  path, so a server echoing the same text for every request is not reported.
  The request only reads; no keyword file is uploaded and no command runs.
cves: [CVE-2001-1130]
cvss: 7.5
severity: high
category: rce
confidence_base: 0.30
tags: [suse, sdbsearch, cgi, referer, path-traversal, intrusive]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2001-1130"
  # OpenVAS/Greenbone NASL 2008/sdbsearch.nasl (GPL-2.0-only)

steps:
  - id: init-probe-r
    action: set_var
    var_name: probe_r
    var_value: {status: 0, body: ""}
    loop:
      var: dir
      over: ["/cgi-bin", ""]

  - id: init-ctrl-r
    action: set_var
    var_name: ctrl_r
    var_value: {status: 0, body: ""}

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

  - id: probe
    action: http_request
    method: GET
    path: "{{dir}}/sdbsearch.cgi?stichwort=anything"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    headers:
      Referer: "http://{{target_host}}:{{port}}/../../../../etc"
    store_as: probe_r

  - id: probe-marker
    action: match
    source: probe_r.body
    pattern: "htdocs//\\.\\./\\.\\./\\.\\./\\.\\./etc/keylist\\.txt"
    store_as: probe_m

  # Control: same script, innocuous Referer.
  - id: control
    action: http_request
    method: GET
    path: "{{dir}}/sdbsearch.cgi?stichwort=anything"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    headers:
      Referer: "http://{{target_host}}:{{port}}/noctis-{{oob_token}}"
    condition: "probe_m.matched"
    store_as: ctrl_r

  - id: control-marker
    action: match
    source: ctrl_r.body
    pattern: "\\.\\./\\.\\./\\.\\./\\.\\./etc/keylist\\.txt"
    condition: "probe_m.matched"
    on_match:
      set_vars:
        ctrl_hit: true

  - id: report
    action: match
    source: probe_r.body
    pattern: "htdocs//\\.\\./\\.\\./\\.\\./\\.\\./etc/keylist\\.txt"
    condition: "probe_m.matched && ctrl_r.status != 0 && ctrl_hit == false"
    on_match:
      finding:
        title: "SuSE sdbsearch.cgi follows the Referer header out of its directory (CVE-2001-1130)"
        description: "sdbsearch.cgi answered a request carrying 'Referer: /../../../../etc' with the path it built from the header (htdocs//../../../../etc/keylist.txt), while a request with a harmless Referer did not. The script takes the location of its keyword file from the Referer, which lets an attacker who can place a keylist.txt run commands as the web server user."
        remediation: "Remove sdbsearch.cgi (SuSE Linux 6.0-7.2 support database); it is unmaintained and was withdrawn by the vendor."
        confidence_delta: 0.50
        qod: 75
        evidence: "{{dir}}/sdbsearch.cgi with Referer .../../../../etc returned the path htdocs//../../../../etc/keylist.txt; control Referer did not"
      stop: true

View these feeds on GitHub