Serendipity — 1 vulnerability check

noctis ships 1 vulnerability check for Serendipity, covering 1 CVE; each one has to observe the bug on the live service before it reports a finding.

← All products · Feeds on GitHub

Serendipity Xinha ImageManager Configuration Signature Bypass

CVECVE-2010-1916
Severityhigh · CVSS 7.5
Categoryauth-bypass — Auth bypass
Serviceshttp, https
Detectionscript, set_var, http_request, match · highest QoD 75
Feedtests/vulnerabilities/serendipity/CVE-2010-1916.yaml

Tests the Xinha WYSIWYG editor bundled with Serendipity (1.5.2 and earlier, under /htmlarea) and standalone Xinha copies for the configuration signature bypass of the ImageManager plugin: the request names the session key that holds the signing secret, so a key that does not exist turns the secret into an empty string and the signature into a plain SHA-1 of the configuration. The feed requests plugins/ImageManager/manager.php with a configuration holding only an unused random entry, its SHA-1 as signature and a random session key name, and reports when the page accepts it and prints the rebuilt backend URL with the forged signature; a second request with a wrong signature must be refused with "Backend security error.". No setting the plugin uses is changed and no file is uploaded or modified.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET {{dir}}/plugins/ImageManager/manager.php?backend_config={{g.cfg_q}}&backend_config_ha…
  3. Parses / computes the next value with a Rhai script
  4. HTTP(S) request GET {{dir}}/plugins/ImageManager/manager.php?backend_config={{g.cfg_q}}&backend_config_ha…
  5. Parses / computes the next value with a Rhai script
  6. Checks hit for ^/ → finding QoD 75: Serendipity Xinha ImageManager Configuration Signature Bypass (CVE-2010-1916)

References:

Feed source — tests/vulnerabilities/serendipity/CVE-2010-1916.yaml
# Serendipity / Xinha ImageManager "deprecated config passing" bypass — CVE-2010-1916
#
# Serendipity 1.5.2 and earlier bundles the Xinha WYSIWYG editor under
# /htmlarea. Its ImageManager plugin (plugins/ImageManager/config.inc.php)
# still honours the "deprecated config passing" request parameters:
#
#   session_start();
#   $secret = $_SESSION[$_REQUEST['backend_config_secret_key_location']];
#   if($_REQUEST['backend_config_hash'] !== sha1($_REQUEST['backend_config'] . $secret))
#     die("Backend security error.");
#   $IMConfig = array_merge($IMConfig, unserialize($_REQUEST['backend_config']));
#   $IMConfig['backend_url'] .= "backend_config=" . rawurlencode(...) . '&' ... ;
#
# The caller picks the session key that holds the secret: naming a key that
# does not exist makes the secret empty, so sha1(backend_config) is a valid
# signature and any unauthenticated visitor can rewrite the plugin
# configuration (base_dir, images_dir, upload rights...), which leads to
# file inclusion / upload of code. The ImageManager sibling
# ExtendedFileManager checks array_key_exists() first and is not affected.
# Serendipity 1.5.3 (2010-05-10, commit 0575e407 / 6836ebbf) unsets
# backend_config / backend_data in contrib/php-xinha.php and disables the
# signed-data reader.
#
# Detection (no configuration change): under each candidate Xinha folder,
# GET plugins/ImageManager/manager.php with backend_config = a serialized
# one-entry array holding a random key ("noctis" => <random hex>, merged into
# the config but read by nothing), backend_config_hash = sha1(backend_config)
# and backend_config_secret_key_location = a random session key that cannot
# exist. A vulnerable copy accepts the forged signature and prints the
# rebuilt backend URL "backend_config=<value>&backend_config_hash=<sha1>&
# backend_config_secret_key_location=<key>&" in manager.php's _backend_url.
# A control request with a wrong hash must then be refused with
# "Backend security error." (and not echo its hash), which rules out pages
# that reflect the query string (QoD 75).
#
# Improvements over the source NASL:
#   - The NASL reports any Serendipity <= 1.5.2 whose Xinha example page
#     htmlarea/examples/ExtendedDemo.html exists; it never sends the forged
#     configuration. Serendipity 1.5.3 still ships that example page, so the
#     NASL relies on the version alone. The feed proves the forged signature
#     is accepted, and needs no version (backported fixes, edited copies and
#     standalone Xinha <= 0.96 beta 2 installs are judged by behaviour).
#   - The feed checks a refused wrong-hash control, so a page reflecting the
#     query string is not reported.
#
# CVSS: CVE-2010-1916 v2 7.5 (NVD has no v3 score).
#
# Ported from OpenVAS/Greenbone NVT 2010/gb_serendipity_sec_bypass_vuln.nasl
# (OID 1.3.6.1.4.1.25623.1.0.801337, GPL-2.0-only).
uid: 5a42416e-802d-4732-a74d-0a140d3b9dfb
name: "Serendipity Xinha ImageManager Configuration Signature Bypass (CVE-2010-1916)"
description: |
  Tests the Xinha WYSIWYG editor bundled with Serendipity (1.5.2 and
  earlier, under /htmlarea) and standalone Xinha copies for the
  configuration signature bypass of the ImageManager plugin: the request
  names the session key that holds the signing secret, so a key that does
  not exist turns the secret into an empty string and the signature into a
  plain SHA-1 of the configuration. The feed requests
  plugins/ImageManager/manager.php with a configuration holding only an
  unused random entry, its SHA-1 as signature and a random session key
  name, and reports when the page accepts it and prints the rebuilt backend
  URL with the forged signature; a second request with a wrong signature
  must be refused with "Backend security error.". No setting the plugin
  uses is changed and no file is uploaded or modified.
cves: [CVE-2010-1916]
cvss: 7.5
severity: high
category: auth-bypass
confidence_base: 0.30
tags: [serendipity, xinha, php, imagemanager, auth-bypass, unauthenticated]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2010-1916"
  - "https://github.com/s9y/Serendipity/commit/6836ebbf28a3b10184217db727c2b0d8a67f2d03"
  # OpenVAS/Greenbone NASL 2010/gb_serendipity_sec_bypass_vuln.nasl (GPL-2.0-only)

steps:
  # Forged configuration: one unused random entry, signed with an empty secret.
  - id: gen
    action: script
    code: |
      let tok = rand_hex(8);
      let cfg = "a:1:{s:6:\"noctis\";s:16:\"" + tok + "\";}";
      let q = "a%3A1%3A%7Bs%3A6%3A%22noctis%22%3Bs%3A16%3A%22" + tok + "%22%3B%7D";
      let loc = "noctis" + rand_hex(6);
      #{ cfg_q: q, hash: sha1(cfg), bad: sha1(cfg + loc), loc: loc }
    store_as: g

  - id: init-hit
    action: set_var
    var_name: hit
    var_value: ""

  # ── Loop group: every following step runs once per Xinha folder ──────────
  - id: init-probe
    action: set_var
    var_name: probe
    var_value: {status: 0, body: ""}
    loop:
      var: dir
      over: ["/htmlarea", "/serendipity/htmlarea", "/blog/htmlarea", "/s9y/htmlarea", "/xinha"]

  - id: init-ctl
    action: set_var
    var_name: ctl
    var_value: {status: 0, body: ""}

  - id: init-accepted
    action: set_var
    var_name: accepted
    var_value: false

  - id: send-forged
    action: http_request
    method: GET
    path: "{{dir}}/plugins/ImageManager/manager.php?backend_config={{g.cfg_q}}&backend_config_hash={{g.hash}}&backend_config_secret_key_location={{g.loc}}"
    port: "{{port}}"
    tls_insecure: true
    timeout_secs: 15
    condition: 'hit == ""'
    store_as: probe

  # The rebuilt backend URL carries the forged config, hash and key name.
  - id: check-forged
    action: script
    condition: 'hit == ""'
    code: |
      let b = if type_of(probe.body) == "string" { probe.body } else { "" };
      probe.status == 200 && b.contains("backend_config=" + g.cfg_q + "&backend_config_hash=" + g.hash + "&backend_config_secret_key_location=" + g.loc + "&") && !b.contains("Backend security error.")
    store_as: accepted

  # Control: same request with a wrong hash must be refused.
  - id: send-control
    action: http_request
    method: GET
    path: "{{dir}}/plugins/ImageManager/manager.php?backend_config={{g.cfg_q}}&backend_config_hash={{g.bad}}&backend_config_secret_key_location={{g.loc}}"
    port: "{{port}}"
    tls_insecure: true
    timeout_secs: 15
    condition: 'hit == "" && accepted'
    store_as: ctl

  - id: verdict
    action: script
    condition: 'hit == "" && accepted'
    code: |
      let b = if type_of(ctl.body) == "string" { ctl.body } else { "" };
      if b.contains("Backend security error.") && !b.contains(g.bad) { dir } else { "" }
    store_as: hit

  # ── Finding ───────────────────────────────────────────────────────────────
  - id: report
    action: match
    source: hit
    pattern: "^/"
    on_match:
      finding:
        title: "Serendipity Xinha ImageManager Configuration Signature Bypass (CVE-2010-1916)"
        description: "The ImageManager plugin of the Xinha editor accepted a configuration signed with an empty secret: the request named a session key that does not exist as the location of the signing secret, and the plugin took the plain SHA-1 of the configuration as valid and merged it, while a wrong signature was refused with \"Backend security error.\". Any unauthenticated visitor can therefore override the plugin configuration (base directory, image directory, upload rights), which allows file inclusion and the upload of executable code."
        remediation: "Upgrade Serendipity to 1.5.3 or later (standalone Xinha to 0.96.1 or later), or remove the htmlarea/plugins/ImageManager, ExtendedFileManager, InsertSnippet and Linker folders if the bundled editor plugins are not used."
        confidence_delta: 0.50
        qod: 75
        evidence: "{{hit}}/plugins/ImageManager/manager.php accepted backend_config signed as sha1(config) with secret location {{g.loc}} (rebuilt backend URL printed); the same request with a wrong hash was refused with \"Backend security error.\""
      stop: true

View these feeds on GitHub