PDG Shopping Cart — 1 vulnerability check

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

← All products · Feeds on GitHub

PDGSoft PDG Shopping Cart redirect.exe / changepw.exe buffer overflow

CVECVE-2000-0401
Severityhigh · CVSS 7.5
Categoryrce — Remote code execution
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 70
Feedtests/vulnerabilities/pdg-shopping-cart/CVE-2000-0401.yaml

Detects the redirect.exe and changepw.exe programs of the PDGSoft PDG Shopping Cart. Unpatched copies overflow an internal buffer when called with an overly long query string, which lets an unauthenticated remote attacker run code with the rights of the web server (CVE-2000-0401). The test requests changepw.exe and redirect.exe under the web root, /cgi-bin, /scripts, /PDG_Cart and /cgi-bin/PDG_Cart, and reports one that answers with HTTP 200 (or, for redirect.exe, a redirect), while a random .exe name in the same directory is refused with a 4xx status (so servers that answer every path are not reported). The overflow itself is never sent; the vendor patch did not rename the programs, so a patched cart is reported too and must be checked against the vendor's fix.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET {{loc.dir}}/{{loc.file}}
  3. HTTP(S) request GET {{loc.dir}}/{{ctl}}.exe
  4. Parses / computes the next value with a Rhai script
  5. Checks verdict for ^PDG_PROGRAM_PRESENT$ → finding QoD 70: PDG Shopping Cart … present — CVE-2000-0401

References:

Feed source — tests/vulnerabilities/pdg-shopping-cart/CVE-2000-0401.yaml
# PDGSoft PDG Shopping Cart — redirect.exe / changepw.exe query-string buffer
# overflows (CVE-2000-0401, BID 1256, Cerberus advisory CISADV000525,
# Bugtraq 2000-05-25 "PDGSoft Shopping Cart buffer overflows")
#
# Credit: target files adapted from Greenbone's `pre2008/changepw.nasl`
# (GPL-2.0-only), which reports when <dir>/changepw.exe or <dir>/redirect.exe
# exists (http_is_cgi_installed_ka) under / and the CGI directories.
#
# Advisory facts: redirect.exe and changepw.exe, two executables shipped with
# the PDG Shopping Cart (UNIX and NT), are reachable over the web; an overly
# long query string overflows an internal buffer and overwrites the saved
# return address, so a remote attacker runs code as the web server. PDGSoft
# shipped a patch for every platform; the advisory names no version numbers.
#
# Why no exploitation proof: the only trigger is the overflow itself, which
# crashes the CGI (or runs attacker code). There is no benign input that tells
# a patched binary from a vulnerable one, and the vendor patch kept the same
# file names, so this stays a presence check at QoD 70, like the reference.
#
# Better than the reference check:
#  - also looks in /PDG_Cart/ and /cgi-bin/PDG_Cart/, the cart's own install
#    directory (its shopper.conf / order.log live there);
#  - a random sibling .exe in the same directory is requested as a control and
#    must be refused with a 4xx status, so catch-all / soft-404 servers that
#    answer 200 (or redirect) for any name are not reported; a control that
#    gets no reply gives no finding (fail-closed);
#  - besides 200, a redirect (30x) from redirect.exe counts — that is what the
#    program does when called.
uid: 57caa527-8acd-4e43-9a40-b19657ace290
name: "PDGSoft PDG Shopping Cart redirect.exe / changepw.exe buffer overflow (CVE-2000-0401)"
description: |
  Detects the redirect.exe and changepw.exe programs of the PDGSoft PDG
  Shopping Cart. Unpatched copies overflow an internal buffer when called with
  an overly long query string, which lets an unauthenticated remote attacker
  run code with the rights of the web server (CVE-2000-0401). The test
  requests changepw.exe and redirect.exe under the web root, /cgi-bin,
  /scripts, /PDG_Cart and /cgi-bin/PDG_Cart, and reports one that answers with
  HTTP 200 (or, for redirect.exe, a redirect), while a random .exe name in the same directory is
  refused with a 4xx status (so servers that answer every path are not
  reported). The overflow itself is never sent; the vendor patch did not
  rename the programs, so a patched cart is reported too and must be checked
  against the vendor's fix.
cves: [CVE-2000-0401]
cvss: 7.5
severity: high
category: rce
confidence_base: 0.30
tags: [pdgsoft, pdg-shopping-cart, cgi, buffer-overflow, rce]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2000-0401"
  - "https://marc.info/?l=bugtraq&m=95928319715983&w=2"
  - "http://www.securityfocus.com/bid/1256"

steps:
  # Random sibling name for the soft-404 control, shared by every location.
  - id: mint-control
    action: script
    code: '"noctis" + rand_hex(8)'
    store_as: ctl

  # ── Per location: this step and every following one ──
  # Pre-initialised so a failed request leaves no undefined variable behind.
  - id: init-page
    action: set_var
    var_name: page
    var_value: {status: 0}
    loop:
      over:
        - {dir: "", file: "changepw.exe"}
        - {dir: "", file: "redirect.exe"}
        - {dir: "/cgi-bin", file: "changepw.exe"}
        - {dir: "/cgi-bin", file: "redirect.exe"}
        - {dir: "/scripts", file: "changepw.exe"}
        - {dir: "/scripts", file: "redirect.exe"}
        - {dir: "/PDG_Cart", file: "changepw.exe"}
        - {dir: "/PDG_Cart", file: "redirect.exe"}
        - {dir: "/cgi-bin/PDG_Cart", file: "changepw.exe"}
        - {dir: "/cgi-bin/PDG_Cart", file: "redirect.exe"}
      var: loc

  - id: init-control
    action: set_var
    var_name: control
    var_value: {status: 0}

  - id: probe-program
    action: http_request
    method: GET
    path: "{{loc.dir}}/{{loc.file}}"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    store_as: page

  - id: probe-control
    action: http_request
    method: GET
    path: "{{loc.dir}}/{{ctl}}.exe"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: "page.status == 200 || (loc.file == \"redirect.exe\" && [301, 302, 303, 307, 308].contains(page.status))"
    store_as: control

  # Fixed verdict string as the match source, so no page content reaches the
  # finding.
  - id: verdict
    action: script
    code: |
      let v = "";
      let hit = page.status == 200 || (loc.file == "redirect.exe" && [301, 302, 303, 307, 308].contains(page.status));
      if hit && control.status >= 400 && control.status < 500 { v = "PDG_PROGRAM_PRESENT"; }
      v
    store_as: verdict

  - id: program-present
    action: match
    source: verdict
    pattern: '^PDG_PROGRAM_PRESENT$'
    on_match:
      finding:
        title: "PDG Shopping Cart {{loc.file}} present — CVE-2000-0401"
        description: "{{loc.dir}}/{{loc.file}} of the PDGSoft PDG Shopping Cart answered, while a random .exe name in the same directory was refused. Unpatched copies of redirect.exe and changepw.exe overflow an internal buffer on an overly long query string, letting an unauthenticated attacker run code as the web server (CVE-2000-0401). The overflow was not sent, so a copy carrying the vendor patch cannot be told apart."
        remediation: "Apply PDGSoft's patch for redirect.exe and changepw.exe on every platform, or remove both programs from the web server. The PDG Shopping Cart is long unsupported: migrate to a maintained shopping cart."
        confidence_delta: 0.40
        qod: 70
        evidence: "GET {{loc.dir}}/{{loc.file}} returned HTTP {{page.status}}; control GET {{loc.dir}}/{{ctl}}.exe returned HTTP {{control.status}}"
      stop: true

View these feeds on GitHub