DeleGate — 1 vulnerability check

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

← All products · Feeds on GitHub

DeleGate proxy multiple buffer overflows (version up to 8.11.0)

CVECVE-2005-0861
Severityhigh · CVSS 7.5
Categoryrce — Remote code execution
Serviceshttp, https, http-proxy, pop3, pop3-proxy, ftp-proxy, smtp-proxy
Ports8080
Detectiontcp_connect, script, match · highest QoD 70
Feedtests/vulnerabilities/delegate/CVE-2005-0861.yaml

Detects a DeleGate multi-protocol proxy server at version 8.11.0 or older. These releases have several buffer overflows ("overflows on arrays") that let a remote attacker crash the proxy and possibly run code on it; they are fixed in DeleGate 8.11.1.

The test sends one plain `GET / HTTP/1.0` request (over TLS on HTTPS services) and reads the reply. It reports the host when the `Server:` response header names `DeleGate/<version>`, or when the service greeting is a DeleGate POP3, FTP or SMTP proxy greeting (`+OK Proxy-POP server (DeleGate/<version> …`, `PROXY-FTP server (DeleGate/<version>)`, `SMTP/DeleGate/<version>`), with a version up to 8.11.0. The version is compared numerically; DeleGate 8.11.1 and later and other servers are not reported. A DeleGate string in a page body is ignored.

This is a version check: the only way to confirm the overflows would be to crash the proxy, so no overflow payload is ever sent.

How noctis detects it

  1. Raw TCP (TLS on HTTPS), sent verbatim: GET / HTTP/1.0
  2. Parses / computes the next value with a Rhai script
  3. Checks ver.version for ^[0-9] → finding QoD 70: DeleGate proxy vulnerable to multiple buffer overflows

References:

Feed source — tests/vulnerabilities/delegate/CVE-2005-0861.yaml
# DeleGate multi-protocol proxy — multiple buffer overflows ("overflows on
# arrays") fixed in 8.11.1, CVE-2005-0861.
#
# Credit: detection logic adapted from Greenbone's
# `pre2008/delegate_overflow2.nasl` (GPL-2.0-only), which matches the POP3
# greeting `^\+OK Proxy-POP server \(Delegate/<ver> by` and the HTTP
# `Server: DeleGate/<ver>` header for versions before 8.10.3.
#
# Why no exploit proof: the flaws are memory-corruption overflows whose only
# observable, non-destructive outcome would be the proxy crashing. There is no
# benign in-band or OOB proof, so this is a version check (QoD 70), which the
# project accepts when no better method exists. No overflow payload is sent.
#
# Improvements over the source check:
#   - version range: NVD marks every DeleGate up to and including 8.11.0 as
#     vulnerable (fixed in 8.11.1); the source check stops at 8.10.2 and so
#     misses 8.10.3 to 8.11.0. This feed flags every release up to 8.11.0, and
#     compares the version numerically instead of with a prefix regex.
#   - the POP3 regex of the source check is case-sensitive "Delegate", while the
#     real greeting reads "DeleGate" (nmap-service-probes:
#     "+OK Proxy-POP server (DeleGate/9.9.7 by ysato AT delegate DOT org) at
#     host starting."), so that branch never fired. Matching here is
#     case-insensitive on the product token.
#   - the FTP ("220- host PROXY-FTP server (DeleGate/x) ready.") and SMTP
#     ("220 host SMTP/DeleGate/x ready at …") greetings, from the same
#     nmap-service-probes entries, are recognised too: the overflows are in the
#     DeleGate core, whatever protocol it relays.
#   - only Server: lines of the HTTP header block (and only the first line for a
#     greeting) are read, so a DeleGate string in a page body cannot match.
#
# CVSS: NVD has only a v2 score for this CVE (7.5, AV:N/AC:L/Au:N/C:P/I:P/A:P).
uid: 2d337ac3-33b7-4962-995a-35cdcce97a03
name: "DeleGate proxy multiple buffer overflows (version up to 8.11.0)"
description: |
  Detects a DeleGate multi-protocol proxy server at version 8.11.0 or older.
  These releases have several buffer overflows ("overflows on arrays") that
  let a remote attacker crash the proxy and possibly run code on it; they are
  fixed in DeleGate 8.11.1.

  The test sends one plain `GET / HTTP/1.0` request (over TLS on HTTPS
  services) and reads the reply. It reports the host when the `Server:`
  response header names `DeleGate/<version>`, or when the service greeting is
  a DeleGate POP3, FTP or SMTP proxy greeting (`+OK Proxy-POP server
  (DeleGate/<version> …`, `PROXY-FTP server (DeleGate/<version>)`,
  `SMTP/DeleGate/<version>`), with a version up to 8.11.0. The version is
  compared numerically; DeleGate 8.11.1 and later and other servers are not
  reported. A DeleGate string in a page body is ignored.

  This is a version check: the only way to confirm the overflows would be to
  crash the proxy, so no overflow payload is ever sent.
category: rce
cves: [CVE-2005-0861]
cvss: 7.5
severity: high
confidence_base: 0.30
tags: [delegate, proxy, http-proxy, pop3, buffer-overflow, version-check, unauthenticated]
services: [http, https, http-proxy, pop3, pop3-proxy, ftp-proxy, smtp-proxy]
ports: [8080]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2005-0861"
  - "http://www.delegate.org/mail-lists/delegate-en/2840"
  - "http://secunia.com/advisories/14649"
  - "https://exchange.xforce.ibmcloud.com/vulnerabilities/19775"

steps:
  # 1 — one plain request. A POP3/FTP/SMTP proxy greets first, so its greeting
  #     is the first line of the reply; an HTTP server answers with headers.
  - id: probe
    action: tcp_connect
    port: "{{port}}"
    send: "GET / HTTP/1.0\r\nHost: {{target_host}}\r\n\r\n"
    timeout_secs: 10
    store_as: resp

  # 2 — DeleGate/<major>.<minor>.<patch> from a Server: header line or from the
  #     greeting line, compared against the last vulnerable release 8.11.0.
  - id: version
    action: script
    store_as: ver
    code: |
      let out = #{ vulnerable: false, version: "", source: "" };
      if type_of(resp.banner) == "string" {
        let head = resp.banner;
        let cut = stridx(head, "\r\n\r\n");
        if cut < 0 { cut = stridx(head, "\n\n"); }
        if cut >= 0 { head = substr(head, 0, cut); }
        let lines = split(head, "\n");
        let found = "";
        let src = "";
        if lines.len() > 0 {
          let first = chomp(lines[0]);
          let g = eregmatch("^(\\+OK Proxy-POP server \\(DeleGate/|220[- ].*PROXY-FTP server \\(DeleGate/|220[- ].*SMTP/DeleGate/)([0-9]+\\.[0-9]+\\.[0-9]+)", first, true);
          if g.len() > 2 { found = g[2]; src = first; }
        }
        if found == "" {
          for raw in lines {
            let line = eregmatch("^server:[ \\t]*([^\\r]*)", raw, true);
            if line.len() < 2 { continue; }
            let m = eregmatch("(^|[^A-Za-z0-9_])DeleGate/([0-9]+\\.[0-9]+\\.[0-9]+)", line[1], true);
            if m.len() < 3 { continue; }
            found = m[2];
            src = "Server: " + line[1];
            break;
          }
        }
        if found != "" {
          let p = eregmatch("^([0-9]+)\\.([0-9]+)\\.([0-9]+)", found);
          let a = int(p[1]);
          let b = int(p[2]);
          let c = int(p[3]);
          out.version = found;
          out.source = src;
          out.vulnerable = a < 8 || (a == 8 && (b < 11 || (b == 11 && c == 0)));
        }
      }
      out

  - id: vulnerable_version
    action: match
    condition: "ver.vulnerable == true"
    source: ver.version
    pattern: "^[0-9]"
    on_match:
      stop: true
      finding:
        title: "DeleGate proxy vulnerable to multiple buffer overflows"
        description: "The service identifies itself as DeleGate {{ver.version}}. DeleGate 8.11.0 and older have several buffer overflows that let a remote attacker crash the proxy and possibly execute code."
        remediation: "Upgrade DeleGate to 8.11.1 or later, and restrict access to the proxy ports to trusted networks."
        confidence_delta: 0.45
        qod: 70
        evidence: "{{ver.source}} -> DeleGate {{ver.version}} is 8.11.0 or older (fixed in 8.11.1; no overflow payload sent)."

View these feeds on GitHub