Webalizer — 1 vulnerability check
noctis ships 1 vulnerability check for Webalizer, covering 1 CVE; each one has to observe the bug on the live service before it reports a finding.
← All products · Feeds on GitHub
Webalizer before 2.01-09 report cross-site scripting
| CVE | CVE-2001-0835 |
|---|---|
| Severity | high · CVSS 7.5 |
| Category | xss — XSS |
| Services | http, https |
| Detection | set_var, http_request, script, match · highest QoD 70 |
| Feed | tests/vulnerabilities/webalizer/CVE-2001-0835.yaml |
Detects Webalizer usage reports produced by a version before 2.01-09. Those versions write host names, referrers, search strings and user agents taken from the web server log into the HTML reports without escaping them, so markup sent in a request is rendered in the reports the next time they are generated. Reports are rebuilt offline from the log, so the test cannot observe the injection; it requests the usual report directories (/usage/, /webalizer/, /stats/, /webstats/) and reads the "Generated by The Webalizer Ver." header comment that every report page carries. A version 0.x, 1.x, 2.00 or 2.01 below edit level 09 is reported (QoD 70).
How noctis detects it
- HTTP(S) request
GET {{dir}} - Parses / computes the next value with a Rhai script
- Checks
verdictfor^version:→ finding QoD 70: Webalizer before 2.01-09 — report cross-site scripting (CVE-2001-0835)
References:
- https://nvd.nist.gov/vuln/detail/CVE-2001-0835
- https://www.tenable.com/plugins/nessus/10816
- https://github.com/hyc/webalizer/blob/master/CHANGES
Feed source — tests/vulnerabilities/webalizer/CVE-2001-0835.yaml
# Webalizer report cross-site scripting (CVE-2001-0835).
#
# Ported from OpenVAS/Greenbone NVT pre2008/webalizer.nasl
# (OID 1.3.6.1.4.1.25623.1.0.10816, GPL-2.0-only): fetch /usage/ and
# /webalizer/, flag "Generated by The Webalizer Ver. 0.x/1.x/2.00/2.01 or
# 2.01-00..06".
#
# The bug: Webalizer copied log-derived strings (host names, referrers,
# search strings, user agents) into its static HTML reports without HTML
# escaping, so a request carrying markup in those fields is rendered as HTML
# the next time the reports are generated (fixed in 2.01-09, CHANGES:
# "Security fix for cross-site scripting vulnerability found by Flavio
# Veloso"). The reports are rebuilt by a batch job (cron) from the access
# log, so the injection cannot be observed within a scan: the only remote
# check is the version that every report page writes in its header comment
# <!-- Generated by The Webalizer Ver. 2.01-06 -->
# (output.c write_html_head: "Ver. %s-%s", version, editlvl). QoD 70.
#
# Better than the NVT:
# - The NVT stops at 2.01-06; the advisory and the fixed release put the
# boundary at 2.01-09 (NVD: 2.01-06 "and possibly other versions"), so
# 2.01-07 and 2.01-08 are flagged too.
# - Also tries /stats/ and /webstats/ (common report directories), and the
# report's index.html when the directory itself has no index.
#
# References: https://nvd.nist.gov/vuln/detail/CVE-2001-0835,
# https://www.tenable.com/plugins/nessus/10816 ("Webalizer < 2.01-09"),
# https://github.com/hyc/webalizer (output.c, CHANGES)
uid: 9fc69c0e-14bf-4ba9-bf11-41445396f29d
name: "Webalizer before 2.01-09 report cross-site scripting (CVE-2001-0835)"
description: |
Detects Webalizer usage reports produced by a version before 2.01-09.
Those versions write host names, referrers, search strings and user
agents taken from the web server log into the HTML reports without
escaping them, so markup sent in a request is rendered in the reports
the next time they are generated. Reports are rebuilt offline from the
log, so the test cannot observe the injection; it requests the usual
report directories (/usage/, /webalizer/, /stats/, /webstats/) and reads
the "Generated by The Webalizer Ver." header comment that every report
page carries. A version 0.x, 1.x, 2.00 or 2.01 below edit level 09 is
reported (QoD 70).
category: xss
cves: [CVE-2001-0835]
cvss: 7.5
severity: high
confidence_base: 0.30
tags: [webalizer, xss, version-check]
services: [http, https]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2001-0835"
- "https://www.tenable.com/plugins/nessus/10816"
- "https://github.com/hyc/webalizer/blob/master/CHANGES"
steps:
# One pass per report location. Pre-initialise the stored result: a failed
# request leaves it unset (or stale from the previous pass).
- id: init-page
action: set_var
var_name: page
var_value: {status: 0, body: ""}
loop:
over: ["/usage/", "/webalizer/", "/stats/", "/webstats/", "/usage/index.html", "/webalizer/index.html"]
var: dir
- id: get-report
action: http_request
method: GET
path: "{{dir}}"
port: "{{port}}"
tls_insecure: true
follow_redirects: false
timeout_secs: 10
store_as: page
- id: version
action: script
store_as: verdict
code: |
let b = if page.status == 200 && type_of(page.body) == "string" { page.body } else { "" };
let m = eregmatch("Generated by The Webalizer\\s+Ver(?:\\.|sion)\\s*([0-9]{1,2})\\.([0-9]{1,2})(?:-([0-9]{1,2}))?", b);
if m.len() < 3 { return ""; }
let maj = int(m[1]);
let min = int(m[2]);
let has_edit = m.len() >= 4 && type_of(m[3]) == "string" && m[3] != "";
let edit = if has_edit { int(m[3]) } else { 0 };
let shown = m[1] + "." + m[2] + (if has_edit { "-" + m[3] } else { "" });
let old = maj < 2 || (maj == 2 && min == 0) || (maj == 2 && min == 1 && edit < 9);
if old {
"version: " + dir + " reports were generated by Webalizer " + shown + " (before 2.01-09)"
} else {
""
}
- id: report
action: match
source: verdict
pattern: "^version: "
on_match:
finding:
title: "Webalizer before 2.01-09 — report cross-site scripting (CVE-2001-0835)"
confidence_delta: 0.40 # 0.30 + 0.40 = 0.70
qod: 70
evidence: "{{verdict}}"
remediation: "Upgrade Webalizer to 2.01-09 or later (current 2.23) and regenerate the reports; restrict access to the report directory."
stop: true