WeBid — 1 vulnerability check
noctis ships 1 vulnerability check for WeBid, covering 1 CVE; each one has to observe the bug on the live service before it reports a finding.
← All products · Feeds on GitHub
WeBid user_login.php username Reflected XSS
| CVE | CVE-2014-5101 |
|---|---|
| Severity | medium · CVSS 4.3 |
| Category | xss — XSS |
| Services | http, https |
| Detection | script, set_var, http_request, match · highest QoD 75 |
| Feed | tests/vulnerabilities/webid/CVE-2014-5101.yaml |
Tests WeBid for the reflected cross-site scripting in the username field of the login form (user_login.php). Under the web root, /WeBid, /webid and /auction, the feed posts a login with an empty password and the username "><script>alert(/marker/)</script>, where marker is random for each scan. A vulnerable WeBid copies the username unescaped into the login form it renders after the failed login, so the double quote closes the value attribute and a script element is added. The finding requires a WeBid page holding the injected script element with this scan's marker, verbatim. A version that escapes or strips the username is not reported. The request is a failed login: it changes nothing on the server.
How noctis detects it
- Parses / computes the next value with a Rhai script
- HTTP(S) request
POST {{dir}}/user_login.phpwith a crafted body - Parses / computes the next value with a Rhai script
- Checks
xss_prooffor^"><script>alert\(/noctis[0-9a-f]{12}/\)</script>$→ finding QoD 75: WeBid user_login.php username Reflected XSS (CVE-2014-5101)
References:
- https://nvd.nist.gov/vuln/detail/CVE-2014-5101
- http://packetstormsecurity.com/files/127431/WeBid-1.1.1-Cross-Site-Scripting-LDAP-Injection.html
- http://www.securityfocus.com/bid/68519
- https://github.com/renlok/WeBid/commit/256a5f9d3eafbc477dcf77c7682446cc4b449c7f
Feed source — tests/vulnerabilities/webid/CVE-2014-5101.yaml
# WeBid user_login.php reflected XSS through username — CVE-2014-5101
#
# WeBid prints the username POSTed to user_login.php back into the login form
# of a failed login without HTML escaping (user_login.php:
# 'USER' => $_POST['username'], template: value="{USER}"). Present in 1.1.1
# and every tagged release up to 1.2.2; the master fix (2018) passes it through
# $system->cleanvars(), which strips the tags but leaves quotes. A value such as
# "><script>...</script> closes the value attribute and adds a script element.
#
# Detection (benign, read-only), for each install dir (web root, /WeBid,
# /webid, /auction):
# 1. POST <dir>/user_login.php with username="><script>alert(/<marker>/)</script>,
# an empty password and action=login (a failed login, as in the source
# check), <marker> random per scan.
# 2. Reported when the reply is a WeBid page (">WeBid<", the footer link)
# holding "><script>alert(/<marker>/)</script> verbatim (an optional
# backslash before the quote is accepted: PHP magic_quotes_gpc). QoD 75.
#
# A WeBid set to force HTTPS answers 302 on its plain-HTTP port (redirects
# are not followed): only its HTTPS port is reported.
#
# Improvements over the source NASL:
# - Random marker per scan instead of the fixed alert(document.cookie): a
# page that always prints that string is not reported.
# - Probes the usual install dirs instead of relying on a prior product
# detection, and accepts the magic_quotes_gpc \" breakout.
#
# CVE-2014-5114 ("LDAP injection via the js or cat parameter", same advisory)
# is not tested: WeBid has no LDAP code, and loader.php only includes files
# found in a fixed whitelist (inc/checks/files.php). The source check does not
# test it either.
#
# The register.php TPL_* fields of CVE-2014-5101 are not probed: a request
# that passes the form checks would create an account.
#
# CVSS: NVD has only a CVSS v2 score for CVE-2014-5101 (4.3, medium); the
# issue's 7.5 is the v2 score of CVE-2014-5114.
#
# Ported from OpenVAS/Greenbone NVT 2014/gb_webid_multiple_vuln.nasl
# (GPL-2.0-only).
uid: b21fddd5-fc60-4ce8-a5fe-eb39e895fa65
name: "WeBid user_login.php username Reflected XSS (CVE-2014-5101)"
description: |
Tests WeBid for the reflected cross-site scripting in the username field of
the login form (user_login.php). Under the web root, /WeBid, /webid and
/auction, the feed posts a login with an empty password and the username
"><script>alert(/marker/)</script>, where marker is random for each scan.
A vulnerable WeBid copies the username unescaped into the login form it
renders after the failed login, so the double quote closes the value
attribute and a script element is added. The finding requires a WeBid page
holding the injected script element with this scan's marker, verbatim. A
version that escapes or strips the username is not reported. The request is
a failed login: it changes nothing on the server.
cves: [CVE-2014-5101]
cvss: 4.3
severity: medium
category: xss
confidence_base: 0.30
tags: [webid, auction, xss, php]
services: [http, https]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2014-5101"
- "http://packetstormsecurity.com/files/127431/WeBid-1.1.1-Cross-Site-Scripting-LDAP-Injection.html"
- "http://www.securityfocus.com/bid/68519"
- "https://github.com/renlok/WeBid/commit/256a5f9d3eafbc477dcf77c7682446cc4b449c7f"
# OpenVAS/Greenbone NASL 2014/gb_webid_multiple_vuln.nasl (GPL-2.0-only)
steps:
# Random marker for this scan (letters and hex digits only).
- id: marker
action: script
code: |
"noctis" + oob_token.sub_string(0, 8) + oob_token.sub_string(9, 4)
store_as: tok
# ── Loop group: every following step runs once per install dir.
- id: init-probe-r
action: set_var
var_name: probe_r
var_value: {status: 0, body: ""}
loop:
var: dir
over: ["", "/WeBid", "/webid", "/auction"]
- id: probe
action: http_request
method: POST
path: "{{dir}}/user_login.php"
port: "{{port}}"
headers:
Content-Type: "application/x-www-form-urlencoded"
body: "username=%22%3E%3Cscript%3Ealert%28%2F{{tok}}%2F%29%3C%2Fscript%3E&password=&input=Login&action=login"
tls_insecure: true
follow_redirects: false
timeout_secs: 15
store_as: probe_r
# The injected script element with this scan's marker, right after the
# closing double quote, on a WeBid page — or "".
- id: reflection
action: script
code: |
let out = "";
if probe_r.status == 200 && type_of(probe_r.body) == "string" {
let b = probe_r.body;
if b.contains(">WeBid<") {
// \\? : PHP magic_quotes_gpc prints a backslash before the quote;
// still a breakout in HTML.
if ereg("\\\\?\"><script>alert\\(/" + tok + "/\\)</script>", b) {
out = "\"><script>alert(/" + tok + "/)</script>";
}
}
}
out
store_as: xss_proof
- id: report
action: match
source: xss_proof
pattern: '^"><script>alert\(/noctis[0-9a-f]{12}/\)</script>$'
on_match:
finding:
title: "WeBid user_login.php username Reflected XSS (CVE-2014-5101)"
description: "A failed WeBid login posted with a username ending in a double quote and a script element was answered with a login form holding that username unescaped, so the quote closes the value attribute and the script element is added to the page. An attacker can make a visitor's browser post such a login (for example from a page they control) and run script in the context of the WeBid site."
remediation: "HTML-escape the username before it is printed in the login form (for example htmlspecialchars($_POST['username'], ENT_QUOTES) for the USER template value in user_login.php). No tagged WeBid release up to 1.2.2 escapes it, and the later master change ($system->cleanvars()) strips tags but leaves double quotes and decoded angle brackets, so it should not be relied on alone."
confidence_delta: 0.55
qod: 75
evidence: "POST {{dir}}/user_login.php with username=%22%3E%3Cscript%3E... returned HTTP 200 with a WeBid page containing the injected element: {{xss_proof}}"
stop: true