Primefaces — 1 vulnerability check

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

← All products · Feeds on GitHub

Primetek Primefaces 5.x EL Injection RCE

CVECVE-2017-1000486
Severitycritical · CVSS 9.8
Categoryrce — Remote code execution
Serviceshttp, https
Detectionscript, http_request, match · highest QoD 97
Feedtests/vulnerabilities/primefaces/CVE-2017-1000486.yaml

Detects Primefaces 5.x EL injection (CVE-2017-1000486) at the dynamic-content resource endpoint. A per-run marker is split into two EL string literals that only become contiguous when the server evaluates the expression; the contiguous marker in the response confirms server-side EL evaluation of attacker input (unauthenticated RCE primitive). A patched server reflects the payload unevaluated (or rejects it), so the contiguous marker never appears.

How noctis detects it

  1. Parses / computes the next value with a Rhai script
  2. HTTP(S) request POST /javax.faces.resource/dynamiccontent.properties.xhtml with a crafted body
  3. Checks resp.body for NOCTIS[0-9a-f]{32} → finding QoD 97: Primefaces 5.x EL injection RCE (CVE-2017-1000486)

References:

Feed source — tests/vulnerabilities/primefaces/CVE-2017-1000486.yaml
# Primetek Primefaces 5.x — Expression Language (EL) injection RCE — CVE-2017-1000486
#
# Primefaces 5.x ships a weak, hardcoded crypto password ("primefaces") used to
# protect the `pfdrid` parameter of the dynamic-content resource endpoint
# (/javax.faces.resource/dynamiccontent.properties.xhtml). An attacker who knows
# the key can forge a signed `pfdrid` carrying an EL expression, which the server
# then *evaluates* — leading to unauthenticated remote code execution.
# CISA KEV (2022-01-10), actively exploited.
#
# Safe/inert detection — "expression-evaluation collapse" (same spirit as the
# SpEL/OGNL idiom):
#   * Mint a per-run random token `tok` and a contiguous marker "NOCTIS"+tok.
#   * Send, in `pfdrid`, an EL payload built from TWO separate string literals
#     joined only by EL evaluation: ${'NOCTIS'}${'<tok>'}. On a vulnerable server
#     the EL engine concatenates the two literals and the response therefore
#     contains the *contiguous* marker NOCTIS<tok>.
#   * A server that merely reflects the raw payload (no EL evaluation) emits the
#     halves still separated by EL syntax ('}${') — so the contiguous marker, and
#     the regex NOCTIS[0-9a-f]{32}, never appear. Evaluation is therefore required
#     for a positive, which is what distinguishes vulnerable from patched.
#
# This probe triggers no code execution: the two literals are inert strings; their
# concatenation only proves the EL engine ran on attacker-supplied input.
uid: 715b4acb-4de3-4a2d-b41c-b690a9795959
name: "Primetek Primefaces 5.x EL Injection RCE (CVE-2017-1000486)"
description: |
  Detects Primefaces 5.x EL injection (CVE-2017-1000486) at the dynamic-content
  resource endpoint. A per-run marker is split into two EL string literals that
  only become contiguous when the server evaluates the expression; the contiguous
  marker in the response confirms server-side EL evaluation of attacker input
  (unauthenticated RCE primitive). A patched server reflects the payload
  unevaluated (or rejects it), so the contiguous marker never appears.
cves: [CVE-2017-1000486]
cvss: 9.8
severity: critical
category: rce
confidence_base: 0.25
tags: [primefaces, primetek, el-injection, rce, java, jsf, kev]
services: [http, https]
author: noctis
version: "1.0.0"
references:
  - "https://nvd.nist.gov/vuln/detail/CVE-2017-1000486"
  - "https://github.com/pimps/CVE-2017-1000486"
  - "https://github.com/projectdiscovery/nuclei-templates/blob/main/http/cves/2017/CVE-2017-1000486.yaml"
  - "https://www.rapid7.com/db/?q=CVE-2017-1000486"

steps:
  # ── Mint a per-run token and the contiguous marker ──────────────────────────
  # tok = 32 lowercase hex chars; marker = "NOCTIS" + tok (one contiguous string).
  - id: mint-marker
    action: script
    store_as: el
    code: |
      let t = rand_hex(16);
      #{ tok: t, marker: "NOCTIS" + t }

  # ── EL-injection probe ──────────────────────────────────────────────────────
  # pfdrid carries ${'NOCTIS'}${'<tok>'}: two independent string literals. Only a
  # server that *evaluates* the EL will concatenate them into the contiguous marker.
  - id: el-probe
    action: http_request
    method: POST
    path: "/javax.faces.resource/dynamiccontent.properties.xhtml"
    port: "{{port}}"
    tls_insecure: true
    follow_redirects: false
    timeout_secs: 10
    headers:
      Content-Type: "application/x-www-form-urlencoded"
    body: "pfdrt=sc&ln=primefaces&pfdrid=${'NOCTIS'}${'{{el.tok}}'}"
    store_as: resp

  # ── Confirmation ────────────────────────────────────────────────────────────
  # Positive only when the response carries the CONTIGUOUS marker (NOCTIS + 32 hex):
  #   - regex NOCTIS[0-9a-f]{32} rejects a reflected payload (halves split by '}${')
  #   - stridx gate binds the match to THIS run's token (rejects a static marker)
  - id: el-confirm
    action: match
    source: resp.body
    pattern: "NOCTIS[0-9a-f]{32}"
    condition: "resp.status == 200 && stridx(resp.body, el.marker) >= 0"
    on_match:
      finding:
        title: "Primefaces 5.x EL injection RCE (CVE-2017-1000486)"
        description: "The Primefaces dynamic-content endpoint evaluated an attacker-supplied EL expression: two separate string literals were concatenated server-side into a per-run marker, confirming the EL injection / RCE primitive."
        remediation: "Upgrade Primefaces to a fixed release (per vendor advisory) which removes the hardcoded crypto password and the EL evaluation of pfdrid."
        confidence_delta: 0.70
        qod: 97
        evidence: "Primefaces EL evaluation confirmed — contiguous marker in response proves server-side EL execution of attacker input (CVE-2017-1000486)."
      stop: true

View these feeds on GitHub