TCPDB — 1 vulnerability check
noctis ships 1 vulnerability check for TCPDB, covering 1 CVE; each one has to observe the bug on the live service before it reports a finding.
← All products · Feeds on GitHub
TCPDB user/index.php Administration Page Without Authentication
| CVE | CVE-2009-1670 |
|---|---|
| Severity | high · CVSS 7.5 |
| Category | auth-bypass — Auth bypass |
| Services | http, https |
| Detection | script, set_var, http_request, match · highest QoD 75 |
| Feed | tests/vulnerabilities/tcpdb/CVE-2009-1670.yaml |
Tests whether the TCPDB web application lets anonymous users open its user administration page, user/index.php. TCPDB 3.8 and earlier serve this page without checking for an administrator session, so anyone can create a new administrator account and take over the application. In the web root and in the /tcpdb and /TCPDB directories, the feed first checks that main.php is a TCPDB page. It then requests user/index.php once, without credentials and without following redirects, and reports the installation when the reply is the user-administration page itself (a password field together with an access-level or role field, or links to edit or delete user records) rather than a login redirect, an error or a plain login form. A request to a random page that does not exist in the same directory must not return such a page. The test only reads the page: it submits nothing and adds no account. When user/index.php cannot be checked (no reply, not found or a server error), the feed falls back to the version shown on main.php and reports version 3.8 or earlier. An installation whose user/ area asks for a login or refuses access is not reported.
How noctis detects it
- Parses / computes the next value with a Rhai script
- HTTP(S) request
GET {{dir}}/main.php - Parses / computes the next value with a Rhai script
- HTTP(S) request
GET {{dir}}/user/index.php - HTTP(S) request
GET {{dir}}/user/{{rnd.page}} - Parses / computes the next value with a Rhai script
- Parses / computes the next value with a Rhai script
- Checks
verdictfor^proof:→ finding QoD 75: TCPDB user administration page reachable without authentication - Checks
fallbackfor^version:→ finding QoD 70: TCPDB 3.8 or earlier (user administration without authentication)
References:
- https://nvd.nist.gov/vuln/detail/CVE-2009-1670
- https://www.exploit-db.com/exploits/8626
- http://www.securityfocus.com/bid/34866
- https://exchange.xforce.ibmcloud.com/vulnerabilities/50371
Feed source — tests/vulnerabilities/tcpdb/CVE-2009-1670.yaml
# TCPDB user/ administration pages reachable without authentication — CVE-2009-1670
#
# TCPDB (tcpdb.com PHP database/CMS script) 3.8 and earlier serve the user
# administration area, user/index.php, without checking for an administrator
# session: an anonymous visitor gets the user-management page and can add an
# administrator account (exploit-db 8626 / milw0rm 8626: "go to /path/user,
# add admin"; BID 34866). The vendor never shipped a fix.
#
# Detection, per install directory ("", /tcpdb, /TCPDB):
# 1. GET <dir>/main.php; the directory is a TCPDB install when the page
# answers 200 and names "TCPDB" (version from "TCPDB version <x.y>").
# 2. Proof (QoD 75, read-only): GET <dir>/user/index.php without cookies and
# without following redirects. The install is vulnerable when the page
# answers 200 with the user-administration content: a password input plus
# an access-level / role field or edit/delete links to user records. A
# protected install redirects to its login, answers 401/403, or shows a
# plain login form (no level field, no record links). A control GET to a
# random non-existent page in user/ must NOT return the same kind of page
# (catch-all front controllers). Nothing is submitted, no account is added.
# 3. Fallback (QoD 70): main.php reports TCPDB 3.8 or earlier AND
# user/index.php gave no usable answer (no reply, 404 or 5xx). An install
# whose user/ area answers 401/403, a redirect or any other 200 page has
# the access restriction in place (the only mitigation, no fix exists), so
# it is not reported. Every directory is tried for the proof first; the
# version fallback only runs after that, so a version hit in one directory
# never hides a proof in another.
#
# Deviation from the source detection: the source check only compares
# the version shown on main.php. This feed first proves that the administration
# page is served to an anonymous request, and also reports installs whose
# version string is hidden when the page is open.
# Reply format: the TCPDB source is no longer published (tcpdb.com is gone) and
# the public exploit gives no page content, so the proof only relies on generic
# user-administration form markers, never on product-specific strings.
#
# Ported from OpenVAS/Greenbone NVT 2009/gb_tcpdb_sec_bypass_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.900551, GPL-2.0-only) and its detection
# secpod_tcpdb_detect.nasl.
uid: 5e69dc9b-db96-415f-8597-13e9803f3dbb
name: "TCPDB user/index.php Administration Page Without Authentication (CVE-2009-1670)"
description: |
Tests whether the TCPDB web application lets anonymous users open its user
administration page, user/index.php. TCPDB 3.8 and earlier serve this page
without checking for an administrator session, so anyone can create a new
administrator account and take over the application. In the web root and in
the /tcpdb and /TCPDB directories, the feed first checks that main.php is a
TCPDB page. It then requests user/index.php once, without credentials and
without following redirects, and reports the installation when the reply is
the user-administration page itself (a password field together with an
access-level or role field, or links to edit or delete user records) rather than a
login redirect, an error or a plain login form. A request to a random page
that does not exist in the same directory must not return such a page. The
test only reads the page: it submits nothing and adds no account. When
user/index.php cannot be checked (no reply, not found or a server error),
the feed falls back to the version shown on main.php and reports version 3.8
or earlier. An installation whose user/ area asks for a login or refuses
access is not reported.
cves: [CVE-2009-1670]
cvss: 7.5
severity: high
category: auth-bypass
confidence_base: 0.30
tags: [tcpdb, php, auth-bypass, missing-authentication, admin-panel]
services: [http, https]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2009-1670"
- "https://www.exploit-db.com/exploits/8626"
- "http://www.securityfocus.com/bid/34866"
- "https://exchange.xforce.ibmcloud.com/vulnerabilities/50371"
# OpenVAS/Greenbone NASL 2009/gb_tcpdb_sec_bypass_vuln.nasl (GPL-2.0-only)
steps:
# Random page name for the catch-all control, shared by every pass, and the
# version-fallback candidate collected over all passes.
- id: rnd
action: script
store_as: rnd
code: '#{ page: "nx" + rand_hex(6) + ".php" }'
- id: init-fallback
action: set_var
var_name: fallback
var_value: ""
# Pass 1, per directory: product gate + proof. Pre-initialise every stored
# result each pass: a failed request leaves it unset.
- id: init-main
action: set_var
var_name: mainp
var_value: {status: 0, body: ""}
loop:
over: ["", "/tcpdb", "/TCPDB"]
var: dir
- id: init-user
action: set_var
var_name: usr
var_value: {status: 0, body: ""}
- id: init-control
action: set_var
var_name: ctl
var_value: {status: 0, body: ""}
- id: get-main
action: http_request
method: GET
path: "{{dir}}/main.php"
port: "{{port}}"
tls_insecure: true
timeout_secs: 10
store_as: mainp
- id: fingerprint
action: script
store_as: tc
code: |
let b = if type_of(mainp.body) == "string" { mainp.body } else { "" };
let out = #{ found: false, version: "", old: false };
if mainp.status == 200 && b.contains("TCPDB") {
out.found = true;
let m = eregmatch("TCPDB version ([0-9]{1,3})\\.([0-9]{1,3})\\b", b, true);
if m.len() >= 3 {
out.version = m[1] + "." + m[2];
let a = int(m[1]);
let c = int(m[2]);
out.old = a < 3 || (a == 3 && c <= 8);
}
}
out
- id: get-user-admin
action: http_request
condition: "tc.found == true"
method: GET
path: "{{dir}}/user/index.php"
port: "{{port}}"
tls_insecure: true
follow_redirects: false
timeout_secs: 10
store_as: usr
- id: get-user-control
action: http_request
condition: "tc.found == true && usr.status == 200"
method: GET
path: "{{dir}}/user/{{rnd.page}}"
port: "{{port}}"
tls_insecure: true
follow_redirects: false
timeout_secs: 10
store_as: ctl
# A page is a user-administration page when it carries a password input and
# either an access-level / role field or edit/delete links to user records.
- id: judge
action: script
store_as: verdict
code: |
let is_admin_page = |st, body| {
if st != 200 || type_of(body) != "string" { return ""; }
if !ereg("<input[^>]*type\\s*=\\s*[\"']?password", body, true) { return ""; }
let lvl = eregmatch("<(input|select)[^>]*name\\s*=\\s*[\"']?((user_?|admin_?|access_?)?(level|rank|role|roles|perm|perms|permission|permissions|priv|privs|privilege|privileges)|is_?admin|usertype|user_?type)[\"'\\s/>]", body, true);
if lvl.len() >= 3 { return "access-level field \"" + lvl[2] + "\""; }
let lnk = eregmatch("href\\s*=\\s*[\"']?([^\"'\\s>]*(edit|delete|del|modify|remove)[^\"'\\s>]*[?&;](user_?|u)?id=[0-9]+)", body, true);
if lnk.len() >= 2 { return "user record link \"" + lnk[1] + "\""; }
""
};
let page = if tc.found { is_admin_page.call(usr.status, usr.body) } else { "" };
let catchall = if tc.found && page != "" { is_admin_page.call(ctl.status, ctl.body) != "" } else { false };
let ctl_txt = if ctl.status == 0 { "gave no reply" } else { "answered HTTP " + ctl.status + " without it" };
if page != "" && !catchall {
"proof: " + dir + "/user/index.php served the user-administration page to an anonymous request (HTTP 200, password input + " + page + "; random page user/" + rnd.page + " " + ctl_txt + ")"
} else {
""
}
# Remember the first directory whose version is affected while user/ gave
# no usable answer (no reply, 404, 5xx); reported only after every pass.
- id: collect-fallback
action: script
store_as: fallback
code: |
let unusable = usr.status == 0 || usr.status == 404 || usr.status >= 500;
if fallback == "" && tc.found && tc.old && unusable {
let st = if usr.status == 0 { "gave no reply" } else { "answered HTTP " + usr.status };
"version: " + dir + "/main.php reports TCPDB " + tc.version + " (3.8 or earlier); user/index.php " + st + ", so the open administration page could not be checked"
} else {
fallback
}
- id: report-proof
action: match
source: verdict
pattern: "^proof: "
on_match:
finding:
title: "TCPDB user administration page reachable without authentication"
confidence_delta: 0.50
qod: 75
evidence: "{{verdict}}"
remediation: "TCPDB has no fixed release. Deny web access to the user/ directory (for example with HTTP authentication in front of it) or remove TCPDB."
stop: true
# Pass 2 (runs once, after every directory was tried for the proof).
- id: after-proof
action: set_var
var_name: fallback_done
var_value: true
loop:
over: ["once"]
var: phase
- id: report-version
action: match
source: fallback
pattern: "^version: "
on_match:
finding:
title: "TCPDB 3.8 or earlier (user administration without authentication)"
confidence_delta: 0.40
qod: 70
evidence: "{{fallback}}"
remediation: "TCPDB has no fixed release. Deny web access to the user/ directory (for example with HTTP authentication in front of it) or remove TCPDB."
stop: true