aflog — 1 vulnerability check

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

← All products · Feeds on GitHub

aflog edit_cat.php Cookie-Based Authentication Bypass

CVECVE-2008-4784
Severityhigh · CVSS 7.5
Categoryauth-bypass — Auth bypass
Serviceshttp, https
Detectionset_var, http_request, script, match · highest QoD 75
Feedtests/vulnerabilities/aflog/CVE-2008-4784.yaml

Tests whether the aflog blog administration pages can be opened with a forged authentication cookie. In the /aflog directory and the web root, the feed first requests edit_cat.php without any cookie and requires the page to refuse access ("You do not have access to this page. You must be Signed In as an Admin."). It then repeats the request with the cookie aflog_auth_a=A, which aflog 1.01 accepts as proof of an administrator login. The finding is reported when the second reply is a non-empty HTTP 200 page that no longer contains the refusal message. The probe only requests the category editor form and changes nothing.

How noctis detects it

  1. HTTP(S) request GET {{dir}}/edit_cat.php
  2. Parses / computes the next value with a Rhai script
  3. HTTP(S) request GET {{dir}}/edit_cat.php
  4. HTTP(S) request GET {{dir}}/edit_cat.php
  5. Parses / computes the next value with a Rhai script
  6. Checks proof for ^aflog admin page served on forged aflog_auth_a cookie$ → finding QoD 75: aflog Cookie-Based Authentication Bypass (CVE-2008-4784)

References:

Feed source — tests/vulnerabilities/aflog/CVE-2008-4784.yaml
# aflog edit_*.php cookie authentication bypass — CVE-2008-4784
#
# aflog 1.01 (PHP blog) decides that a visitor is an administrator from the
# value of the client-supplied cookie aflog_auth_a alone: edit_delete.php,
# edit_cat.php, edit_lock.php and edit_form.php run their admin branch when
# $_COOKIE['aflog_auth_a'] is "A" or "O" and otherwise print
# "ERROR! You do not have access to this page. You must be Signed In as an
# Admin." (EDB-6818 quotes the code; the 1.01 source is no longer
# downloadable, the SourceForge project only keeps the unrelated 0.10x line).
#
# Detection (read-only), per candidate dir (/aflog and the web root):
#   1. GET <dir>/edit_cat.php without cookie: the page must print the
#      denial message (it proves the page exists and enforces the check).
#   2. GET <dir>/edit_cat.php with Cookie: aflog_auth_a=A: HTTP 200, a
#      non-empty page that no longer carries the denial message.
#   edit_delete.php / edit_lock.php are deliberately not requested (they act
#   on a record id); edit_cat.php is the category editor form.
#   QoD 75 (response analysis: protected page served on a forged cookie).
#
# Improvements over the source NASL (Readme.txt contains "Aflog v1.01"):
#   - the bypass itself is exercised, so a patched or reconfigured install
#     is not flagged on its version file alone, and installs whose Readme is
#     removed are still found.
#
# CVSS: NVD v2 7.5 (no v3 score published).
#
# Ported from OpenVAS/Greenbone NVT 2008/gb_aflog_cookie_auth_bypass_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.800304, GPL-2.0-only).
uid: 945aa67b-692c-4546-8d25-e022a1c45f58
name: "aflog edit_cat.php Cookie-Based Authentication Bypass (CVE-2008-4784)"
description: |
  Tests whether the aflog blog administration pages can be opened with a
  forged authentication cookie. In the /aflog directory and the web root, the
  feed first requests edit_cat.php without any cookie and requires the page
  to refuse access ("You do not have access to this page. You must be Signed
  In as an Admin."). It then repeats the request with the cookie
  aflog_auth_a=A, which aflog 1.01 accepts as proof of an administrator
  login. The finding is reported when the second reply is a non-empty HTTP
  200 page that no longer contains the refusal message. The probe only
  requests the category editor form and changes nothing.
cves: [CVE-2008-4784]
cvss: 7.5
severity: high
category: auth-bypass
confidence_base: 0.30
tags: [aflog, php, auth-bypass, cookie]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2008-4784"
  - "https://www.exploit-db.com/exploits/6818"
  - "https://www.securityfocus.com/bid/31894"
  # OpenVAS/Greenbone NASL 2008/gb_aflog_cookie_auth_bypass_vuln.nasl (GPL-2.0-only)

steps:
  # ── Loop group: every step below runs once per candidate dir ─────────────
  - id: init-deny
    action: set_var
    var_name: deny
    var_value: {status: 0, body: ""}
    loop:
      over: ["/aflog", ""]
      var: dir

  - id: init-forged
    action: set_var
    var_name: forged
    var_value: {status: 0, body: ""}

  - id: fetch-deny
    action: http_request
    method: GET
    path: "{{dir}}/edit_cat.php"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    store_as: deny

  - id: denied
    action: script
    store_as: is_denied
    code: |
      deny.status == 200 && type_of(deny.body) == "string"
        && egrep("(?i)You do not have access to this page.*Signed In as an Admin", deny.body) != ""

  - id: fetch-forged
    action: http_request
    method: GET
    path: "{{dir}}/edit_cat.php"
    headers:
      Cookie: "aflog_auth_a=A"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: 'is_denied == true'
    store_as: forged

  # Control: a bogus cookie value must still be refused, so a page that merely
  # varies per request or on cookie presence is not reported.
  - id: init-ctl
    action: set_var
    var_name: ctl
    var_value: {status: 0, body: ""}

  - id: fetch-control
    action: http_request
    method: GET
    path: "{{dir}}/edit_cat.php"
    headers:
      Cookie: "aflog_auth_a=X"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 15
    condition: 'is_denied == true'
    store_as: ctl

  - id: verdict
    action: script
    store_as: proof
    code: |
      if is_denied == true && forged.status == 200 && type_of(forged.body) == "string"
        && strlen(forged.body) > 0
        && egrep("(?i)You do not have access to this page", forged.body) == ""
        && ctl.status == 200 && type_of(ctl.body) == "string"
        && egrep("(?i)Signed In as an Admin", ctl.body) != ""
      { "aflog admin page served on forged aflog_auth_a cookie" } else { "" }

  - id: report
    action: match
    source: proof
    pattern: "^aflog admin page served on forged aflog_auth_a cookie$"
    on_match:
      finding:
        title: "aflog Cookie-Based Authentication Bypass (CVE-2008-4784)"
        description: "aflog trusts the client-supplied aflog_auth_a cookie: edit_cat.php refused a request without a cookie but served the administration page when the cookie was set to A. Anyone can obtain administrative access to the blog by setting this cookie."
        remediation: "aflog is no longer maintained. Remove it or replace it with a blog engine that validates a server-side session; as a stop-gap, restrict the edit_*.php scripts at the web server."
        confidence_delta: 0.45
        qod: 75
        evidence: "GET {{dir}}/edit_cat.php without a cookie returned the access-denied message; with Cookie aflog_auth_a=A it returned HTTP 200 without it, while the value X was still refused."
      stop: true

View these feeds on GitHub