ViewVC — 1 vulnerability check

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

← All products · Feeds on GitHub

ViewVC < 1.1.3 per-root authorization bypass (root listing, query.py)

CVECVE-2010-0004, CVE-2010-0005
Severityhigh · CVSS 7.5
Categoryauth-bypass — Auth bypass
Serviceshttp, https
Detectionset_var, http_request, script, match · highest QoD 70
Feedtests/vulnerabilities/viewvc/viewvc-per-root-authz-bypass.yaml

ViewVC before 1.1.3 does not apply per-root authorization everywhere. The root listing view shows every configured repository, including those the authorizer should hide from the user (CVE-2010-0004), and the query.py query interface runs queries on roots configured with an authorizer other than "forbidden", ignoring that authorizer's restrictions (CVE-2010-0005). Both only matter when an authorizer is configured, and which repositories are meant to be private cannot be known from outside, so no request can prove the flaw; this check identifies the version instead.

It requests the ViewVC script at the usual install paths (/viewvc/, /viewvc.cgi/, viewvc.py, under the web root, /svn, /scm and /cgi-bin) and reads the version from the "Powered by ViewVC X" footer link or the "generator" meta tag that every ViewVC page carries. It reports a version lower than 1.1.3, with a lower confidence than an exploit proof. Only a ViewVC page reachable without logging in is checked.

How noctis detects it

  1. HTTP(S) request GET {{url}}
  2. Parses / computes the next value with a Rhai script
  3. Checks hit for runs ViewVC → finding QoD 70: ViewVC < 1.1.3 per-root authorization bypass (CVE-2010-0004, CVE-2010-0005)

References:

Feed source — tests/vulnerabilities/viewvc/viewvc-per-root-authz-bypass.yaml
# ViewVC before 1.1.3 — per-root authorization not applied by the root listing
# view (CVE-2010-0004) and by the query.py interface (CVE-2010-0005). Both are
# fixed by ViewVC 1.1.3 (CHANGES: "security fix: add root listing support of
# per-root authz config", "security fix: query.py requires 'forbidden'
# authorizer (or none) in config").
#
# Why version only (QoD 70): both flaws exist only when the operator configured
# an authorizer (per-root authz-* sections, svnauthz), and what they leak is a
# root name or query result the configuration should have hidden. A scanner
# cannot tell, from outside, which roots or modules are meant to be private,
# so no request can prove the bypass; the check identifies the version.
#
# Real page forms used (ViewVC git tags, templates):
#   - 1.0.x / 1.1.x templates/include/header.ezt:
#       <meta name="generator" content="ViewVC [vsn]" />
#   - 1.0.x / 1.1.x templates/include/footer.ezt:
#       Powered by <a href="http://viewvc.tigris.org/">ViewVC [vsn]</a>
#   - 1.2+ templates/default/include/footer.ezt: same footer with
#       href="http://viewvc.org/"
#   - [vsn] is lib/viewvc.py __version__ ("1.1.2"; "1.1.3-dev" in trunk
#     snapshots; "1.0.0-rc1", "1.1.0-beta1" for pre-releases).
#
# Ported from OpenVAS/Greenbone NVT `2010/viewvc_37518.nasl`
# (OID 1.3.6.1.4.1.25623.1.0.100414, GPL-2.0-only) and its detection
# `viewvc_detect.nasl` (GET <dir>/viewvc/ and <dir>/viewvc.cgi/ for dir in /svn,
# /scm and the CGI dirs; ViewVC when "Powered by <a…>ViewVC" or a
# "<meta…generator…ViewVC" line is present; version from the first
# "ViewVC ([0-9.]+[-dev]*)"; reports version < 1.1.3).
# Differences from the NASL:
#   - also tries /cgi-bin/viewvc/ (ScriptAlias without extension) and
#     viewvc.py (mod_python handler), the other paths viewvc-install sets up;
#   - the version is read only from the footer link or the generator meta tag,
#     never from the first "ViewVC x" anywhere in the page (a log message or a
#     file name such as "ViewVC 1.0 notes" in a directory listing is not the
#     version);
#   - the comparison is numeric per component (1.1.10 is not read as < 1.1.3);
#     a suffixed version ("X.Y.Z-dev", "-beta1", "-rc1") is compared as X.Y.Z,
#     so a 1.1.3-dev snapshot is not reported (it may already carry the fix).
#
# CVSS: NVD carries only CVSS v2 scores — CVE-2010-0004 5.0, CVE-2010-0005 7.5
# (AV:N/AC:L/Au:N/C:P/I:P/A:P); the feed uses the higher one.
uid: 768d3fca-655c-4ebe-b1bd-d2e44d053407
name: "ViewVC < 1.1.3 per-root authorization bypass (root listing, query.py)"
description: |
  ViewVC before 1.1.3 does not apply per-root authorization everywhere. The
  root listing view shows every configured repository, including those the
  authorizer should hide from the user (CVE-2010-0004), and the query.py query
  interface runs queries on roots configured with an authorizer other than
  "forbidden", ignoring that authorizer's restrictions (CVE-2010-0005). Both
  only matter when an authorizer is configured, and which repositories are
  meant to be private cannot be known from outside, so no request can prove
  the flaw; this check identifies the version instead.

  It requests the ViewVC script at the usual install paths (/viewvc/,
  /viewvc.cgi/, viewvc.py, under the web root, /svn, /scm and /cgi-bin) and
  reads the version from the "Powered by ViewVC X" footer link or the
  "generator" meta tag that every ViewVC page carries. It reports a version
  lower than 1.1.3, with a lower confidence than an exploit proof. Only a
  ViewVC page reachable without logging in is checked.
cves: [CVE-2010-0004, CVE-2010-0005]
cvss: 7.5
severity: high
category: auth-bypass
confidence_base: 0.30
tags: [viewvc, subversion, cvs, python, auth-bypass, information-disclosure, version-check]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2010-0004"
  - "https://nvd.nist.gov/vuln/detail/CVE-2010-0005"
  - "https://github.com/viewvc/viewvc/blob/1.1.3/CHANGES"
  - "http://www.securityfocus.com/bid/37518"

steps:
  - id: init-hit
    action: set_var
    var_name: hit
    var_value: ""

  # ── Per candidate script URL (loop group) ─────────────────────────────────
  - id: init-page
    action: set_var
    var_name: page
    var_value: {status: 0, body: ""}
    loop:
      var: url
      over:
        - "/viewvc/"
        - "/viewvc.cgi/"
        - "/viewvc.py/"
        - "/cgi-bin/viewvc.cgi/"
        - "/cgi-bin/viewvc/"
        - "/svn/viewvc/"
        - "/svn/viewvc.cgi/"
        - "/scm/viewvc/"
        - "/scm/viewvc.cgi/"

  - id: fetch-viewvc
    action: http_request
    method: GET
    path: "{{url}}"
    port: "{{port}}"
    tls_insecure: true
    timeout_secs: 15
    condition: 'hit == ""'
    store_as: page

  # Product gate + version: the "Powered by <a …>ViewVC X" footer link, else
  # the <meta name="generator" content="ViewVC X"> tag. Reports < 1.1.3
  # (numeric per component, "-dev"/"-beta1"/"-rc1" suffix ignored).
  - id: check-version
    action: script
    condition: 'hit == ""'
    code: |
      let b = if type_of(page.body) == "string" { page.body } else { "" };
      let ver = "";
      let how = "";
      if page.status == 200 {
        let f = eregmatch("(?i)Powered by\\s*<a\\s[^>]*>\\s*ViewVC\\s+([0-9]{1,4}(?:\\.[0-9]{1,4}){1,3}(?:-[A-Za-z0-9]{1,10})?)\\s*</a>", b);
        if type_of(f) == "array" && f.len() > 1 {
          ver = f[1];
          how = "\"Powered by ViewVC " + f[1] + "\" footer link";
        } else {
          let g = eregmatch("(?i)<meta\\s[^>]*name=[\"']generator[\"'][^>]*content=[\"']ViewVC\\s+([0-9]{1,4}(?:\\.[0-9]{1,4}){1,3}(?:-[A-Za-z0-9]{1,10})?)[\"']", b);
          if type_of(g) == "array" && g.len() > 1 {
            ver = g[1];
            how = "generator meta tag \"ViewVC " + g[1] + "\"";
          }
        }
      }
      let out = "";
      if ver != "" {
        let p = split(split(ver, "-")[0], ".");
        let a = int(p[0]);
        let m = if p.len() > 1 { int(p[1]) } else { 0 };
        let c = if p.len() > 2 { int(p[2]) } else { 0 };
        if a * 1000000 + m * 1000 + c < 1001003 {
          out = url + " runs ViewVC " + ver + " (" + how + ")";
        }
      }
      out
    store_as: hit

  # ── Finding ───────────────────────────────────────────────────────────────
  - id: report
    action: match
    source: hit
    pattern: "runs ViewVC"
    on_match:
      finding:
        title: "ViewVC < 1.1.3 per-root authorization bypass (CVE-2010-0004, CVE-2010-0005)"
        description: "The server runs ViewVC older than 1.1.3. These releases list every configured repository in the root listing view, including those the per-root authorizer should hide, and let the query.py interface query roots whose authorizer it does not support, bypassing that authorizer's restrictions. Detected from the version only; exposure depends on an authorizer being configured."
        remediation: "Upgrade ViewVC to 1.1.3 or later. Until then, disable the 'roots' view (allowed_views) and the query.py interface on installs that rely on per-root authorization."
        confidence_delta: 0.45
        qod: 70
        evidence: "{{hit}}; fixed in 1.1.3"
      stop: true

View these feeds on GitHub