🦹
CYBERSECURITY BOOK
  • 👽CS && PEN-TESTING BOOK
    • 🔍Reconnaissance
      • 🈴Passive Recon
        • M365/Azure Tenant Recon
          • MSFTRecon
        • 🕵️OSINT
          • Data Breach and Leaks Resources
          • OSINT Tools and Resources
          • Shodan
          • Creepy
          • The US Army manual ATP 2-22.9
          • NATO OSINT manual
          • Twitter Geolocation
          • Geotagging: GeoSocial Footprint
          • Bitcoin Address Lookup
          • Google Docs OSINT
          • Monitoring Tools
          • TOR Onion Links
          • Phone Numbers
          • Mitaka - In-Browser Tool
          • Russian Target
          • FTP Servers
          • War Related
        • 🎟️ADINT
          • Surveillance
        • 🗺️GEOINT
          • Methodology
          • SunCalc - Geospatial OSINT using shadows
        • ☢️SIGINT
          • Methodology
          • Wifi
            • Kismet
        • ⛓️DNS Recon and Route Mapping
        • 👨‍💼Obtain User Information
        • 🕸️Web Recon
        • 🕷️Scraping Crypto Addresses
        • File Sharing Services
      • ☢️Active Recon
        • 🐹Stealth Scanning Strategies
        • 🏭Identify Network Infrastructure
        • 💻Host Enumeration
        • ⛷️Sparta
        • 🧩Fuzzing
          • ❄️Wfuzz
          • Fuzzing Applications
          • Linux Kernel Fuzzing
          • Fuzzing Chrome V8 Engine
      • ☦️Doxing
        • Doxing Anyone
        • Gmail Address
      • 🎥Surveillance
        • Location Tracking Techniques
    • 🔢Enumeration
      • 🔅Protocols and Ports
        • 21 - FTP
        • 22 - SSH
        • 23 - Telnet
        • 25, 465 - SMTP
        • 110, 143 - POP3, IMAP4
        • 1521 - Oracle DB Server
        • 3306 - Mysql
        • 2375 - Docker
        • 8080, 50000 - Jenkins
        • 80, 443 - HTTP, HTTPS
        • 3389 - RDP
        • 5900 - VNC
        • 445 - SMB
        • 161 UDP - SNMP
        • 11211 - Memcached
        • 2049 - NFS
      • 🐧Linux - POST
      • 🪟Windows - POST
      • 🕸️Web Apps
        • Directory Enumeration
        • Identify Virtual Websites
    • ☮️Public Exploits
      • Look for Public Exploits
      • Metasploit
    • 🕎Vulnerability Scanning
      • ⚛️Nuclei
      • ⛵Tsunami Security Scanner
      • Hunting and Exploiting Vulnerable Windows Drivers
    • 🕳️Tunneling & Exfiltration
      • SSH Tunneling
      • ICMP Exfiltration
      • DNS Exfiltration
      • DNS Tunneling
      • TCP/UDP Tunneling
      • CloudFlare Tunnel
      • SOCKS
      • Ngrok - Port Forwarding
      • CURL - Exfiltration
      • Rclone - Data Exfiltration
      • Data Bouncing - External Data Exfiltration
    • Backdoors
      • Asymmetric Backdoor
    • 🎣Pivoting (Post Exploitation)
      • Using Metasploit
      • SOCKS, SSH - Pivoting
      • Remote Port Forwarding
      • Tool - Chisel
      • Chisel - Double Pivoting
      • Bypassing Firewall with Forward Relays
      • Reverse Relays - Metasploit
      • Pivoting using Ligolo-Ng
    • 🎯Active Directory Pentesting
      • 🔑Crendentials
        • Group Policy Preferences
        • LLMNR Poisoning
        • LDAP (Post)
        • Brute Force
        • LAPS Toolkit
        • PFX File
      • 🐕‍🦺Kerberos Attacks
        • ASREProast
        • Kerberoast
        • Pass the Certificate
      • 🏁AD Post Exploitation
        • Active Directory Post Exploitation
      • ℹ️Introduction to Identities
      • 🔧Testing Active Directory
      • 🎓Advanced Penetration Testing
      • 🔧Automated Tools
        • ADCS Exploitation Tool
        • BadSuccessor – Full Active Directory Compromise
      • Hacking Active Directory Environment
        • 🕵️Enumeration
        • 🦸Exploitation
        • 🚪Privilege Escalation
      • Windows and Active Directory Attacks
        • Shared Local Administrator Password
        • NTLM/SMB Relay
    • 🐳Docker
      • Docker Container
      • Expose Docker Remotely
    • ☸️Kubernetes
      • Basic Commands
    • 🙅‍♂️Social Engineering
      • 🗺️Location Phishing
      • 🧘‍♂️0-Click Email Attack
      • 🐧Binary Linux Trojan
      • 📧Phishing Mail
      • 📁Malicious File
      • ♉Malicious USB Drive
      • 📩Spear-Phishing Methods (VIP)
      • 🧑‍💼Insider Attack
      • Wifi Phishing - Wifiphisher
      • 🔐MFA Bypass
      • Link Attacks
      • 📋Clipboard Hijacking (Post)
      • Copy-Paste Spoofing
    • 🗺️CEH Mindmaps
      • ℹ️Recon and Information Gathering
        • Lab 1: Perform Footprinting Through Search Engines
          • Task 1: Gather Information using Advanced Google Hacking Techniques
          • Task 2: Gather Information from Video Search Engines
          • Task 3: Gather Information from FTP Search Engines
          • Task 4: Gather Information from IoT Search Engines
        • Lab 2: Perform Footprinting Through Web Services
          • Task 1: Find the Company's Domains and Sub-domains using Netcraft
          • Task 2: Gather Personal Information using PeekYou Online People Search Service
          • Task 3: Gather an Email List using theHarvester
          • Task 4: Gather Information using Deep and Dark Web Searching
          • Task 5: Determine Target OS Through Passive Footprinting
        • Lab 3: Perform Footprinting Through Social Networking Sites
          • Task 1: Gather Employee's Information from LinkedIn using theHarvester
          • Task 2: Gather Personal Information from Various Social Networking Sites using Sherlock
          • Task3: Gather Information using Followerwonk
        • Lab 4: Perform Website Footprinting
          • Task 1: Gather Information About a Target Website using Ping Command Line Utility
          • Task 2: Gather Information About a Target Website using Photon
          • Task 3: Gather Information About a Target Website using Central Ops
          • Task 4: Extract a Company's Data using Web Data Extractor
          • Task 5: Mirror a Target Website using HTTrack Web Site Copier
          • Task 6: Gather Information About a Target Website using GRecon
          • Task 7: Gather a Wordlist from the Target Website using CeWL
        • Lab 5: Perform Email Footprinting
          • Task 1: Gather Information about a Target by Tracing Emails using eMailTrackerPro
        • Lab 6: Perform Whois Footprinting
          • Task 1: Perform Whois Lookup using DomainTools
        • Lab 7: Perform DNS Footprinting
          • Task 1: Gather DNS Information using nslookup Command Line Utility and Online
          • Task 2: Perform Reverse DNS Lookup using Reverse IP Domain Check and DNSRecon
          • Task 3: Gather Information of Subdomain and DNS Records using SecurityTrails
        • Lab 8: Perform Network Footprinting
          • Task 1: Locate Network Range
          • Task 2: Perform Network Tracerouting in Windows and Linux Machines
          • Task 3: Perform Advanced Network Route Tracing Using Path Analyzer Pro
        • Lab 9: Perform Footprinting using Various Footprinting Tools
          • Task 1: Footprinting a Target using Recon-ng
          • Task 2: Footprinting a Target using Maltego
          • Task 3: Footprinting a Target using OSRFramework
          • Task 4: Footprinting a Target using FOCA
          • Task 5: Footprinting a Target using BillCipher
          • Task 6: Footprint a Target using OSNIT Framework
      • 🔄Network Scanning
        • Tasks
      • 🔢Enumeration
        • Tasks
      • 👨‍🔧Vulnerability Analysis
        • Tasks
      • 🦸System Hacking
        • Tasks
      • *️Malware Analysis
        • Tasks
      • ❄️Sniffing
        • Tasks
      • 🧑‍🤝‍🧑Social Engineering
        • Tasks
      • 🚫Denial of Service
        • Tasks
      • 🛩️Session Hijacking
        • Tasks
      • 🆔Evading IDS, Firewalls, and Honeypots
        • Tasks
      • 🖥️Web Server Hacking
        • Tasks
      • 🕸️Web Application Hacking
        • Tasks
      • 💉SQL Injection
        • Tasks
      • 👁️‍🗨️Wireless Network Hacking
        • Tasks
      • 📱Mobile Hacking
        • Tasks
      • 👨‍🔬IoT and OT Hacking
        • Tasks
      • ☁️Cloud Computing
        • Tasks
      • 🔏Cryptography
        • Tasks
    • 🗾CND Mindmaps
    • 👿Vulnerability Research
      • 👨‍💻Code Review
    • 📶Network Security
      • 🦝Installing and Configuring Network Based IDS In Ubuntu: Suricata
      • 🏛️OpenSSL
      • 👩‍🚒Active Directory
        • LAPS
    • 🛂Port Forwarding
      • 🐧Linux
      • 🪟Windows
      • 🔄Router
    • 👾API Testing
      • Reverse Engineering
        • Reverse Engineer an API using MITMWEB and POSTMAN
      • API Hacking Basics
        • Practicals
      • 🕵️‍♂️API Recon
      • 📄API Documentation
        • ⚗️Lab: Exploiting an API endpoint using documentation
      • 👨‍🎤Identifying and Interacting with API Endpoint
        • ⚗️Lab: Finding and exploiting an unused API endpoint
      • 🦮Finding Hidden Parameters
      • 🍷Mass assignment vulnerabilities
        • ⚗️Lab: Exploiting a mass assignment vulnerability
      • ✅Preventing vulnerabilities in APIs
      • 😷Server-side parameter pollution
      • 🕵️‍♂️Testing for server-side parameter pollution in the query string
        • ⚗️Lab: Exploiting server-side parameter pollution in a query string
      • 🛣️Testing for server-side parameter pollution in REST paths
      • 🚧Testing for server-side parameter pollution in structured data formats
        • ⚗️Lab: Exploiting server-side parameter pollution in a REST URL
      • 👨‍🚀Testing with automated tools
      • 🚨Preventing server-side parameter pollution
    • 🕸️Web App Pentesting Notes
      • 🧰Web App Pentesting Tools
        • Fuzzing: ffuf Tool
        • Nosql Injection: NoSqlMap
        • Kiterunner
        • Burp Suite
      • ❌XSS and XSRF Together
      • 💉NoSQL Injection
        • NoSQL Databases
        • NoSQL syntax injection
        • NoSQL operator injection
        • Exploit Syntax Injection to Extract Data
        • Exploiting NoSQL operator injection to extract data
        • Timing based injection
        • Preventing NoSQL injection
      • 🧙Cross Site Request Forgery
      • 📼Hidden Parameter Discovery
      • 📌SSTI : Server Side Template Injection
        • Lab: Basic server-side template injection
        • Lab: Basic server-side template injection (code context)
        • Lab: Server-side template injection using documentation
        • Lab: Server-side template injection in an unknown language with a documented exploit
        • Lab: Server-side template injection with information disclosure via user-supplied objects
      • 💎JWT Attack
        • Exploiting flawed JWT signature verification
        • Brute-forcing secret keys
        • JWT header parameter injections
        • Prevent JWT attacks
      • 📊GraphQL API Vulnerabilities
        • Exploiting Unsanitized Arguments
        • Discovering Schema Information
          • Lab: Accessing private GraphQL posts
          • Lab: Accidental exposure of private GraphQL fields
        • Bypassing GraphQL introspection defenses
          • Lab: Finding a hidden GraphQL endpoint
        • Bypassing rate limiting using aliases
          • Lab: Bypassing GraphQL brute force protections
        • GraphQL CSRF
          • Lab: Performing CSRF exploits over GraphQL
      • 🔏Authentication Vulnerabilities
      • 🏇Race Conditions
        • Limit overrun race conditions
        • Multi Endpoint Race Conditions
        • Single Endpoint Race Conditions
        • Time Sensitive Attacks
      • 🧠LLM Attacks
        • Exploiting LLM APIs, functions, and plugins
        • Indirect Prompt Injection
      • ☸️Host Header Attacks
        • Testing for Vulnerability
        • Password Reset Poisoning
        • Web Cache Poisoning
        • Accessing Restricted Functionality
    • 🛩️Wireless Hacking
      • Zigbee Attacks
      • Wifi Attacks
        • Hack WPA2 Networks
        • Automated: Wifite
      • Bluetooth Attacks
        • BlueDucky Script
      • RFID Attacks
    • 🏁CEH Engage Walkthroughs
      • 1️⃣CEH Engage Part 1
      • 2️⃣CEH Engage Part 2
      • 3️⃣CEH Engage Part 3
      • 4️⃣CEH Engage Part 4
    • 🎃Evasion
      • OWASP-ZSC
      • AMSI Bypass
      • Windows Evasion
      • Windows Defender Application Control (WDAC): Killing EDR
      • InvisibilityCloak - C# Obfuscation Toolkit
    • 🚪Post exploitation
      • 🛬Living Off The Land Tools
      • 🥝Mimikatz
      • 🐧Privilege escalation: Linux
      • 🪟Privilege escalation: Windows
      • 👾PAC Tempering
      • Amnesiac - EDR Bypass
      • GraphRunner: A Post-Exploitation Toolset for Microsoft 365
    • 🔓Hashing & Password Cracking
      • Hashing
      • Custom Wordlist
      • Hydra
      • John
      • Windows - Local Password Cracking
      • Password Cracking using Rules
    • 📒Hacking Cheat Sheets
      • 🔍Recon Cheatsheet
      • 🔢Enumeration Cheatsheet
      • 🐚Shells and Reverse Shells Cheat Sheet
      • 🐮Meterpreter Cheat Sheet
      • ☄️Powershell Commands Cheat Sheet
      • 💉Command Injection Cheat Sheet
      • 🪡SQL Injection Cheat Sheet
      • 🐮Metasploit Cheat Sheet
      • 🧰Ethical Hacking Tools
      • 🐧Linux Hacking Basics
      • 🔺MSFVenom
    • 🏇CEH Practical
      • CEH Practical Tools
      • 🔍Network Scanning
      • 🐕‍🦺Service Enumeration
      • 🖊️Stegnography
      • 🔓Cryptography
      • 🕸️Web and Android Hacking
      • 🚪Privilege Escalation
      • 🦄Malware Threats
    • ☁️Cloud Pentesting
      • ✏️AWS Pentesting
        • 🌆AWS Environments
          • Identity and Access Management
          • Identity Based Policies
          • Resource Based Policy
          • Untitled
        • 🧰Tools
          • AWS CLI
          • Pacu
          • Prowler
          • Cloudsplaining
        • Attacks & Methodology
          • 👨‍🔬Exploiting AWS Misconfigurations
          • AWS Pentest Methodology
        • Initial Access
          • Public Access
          • Leaked Secrets
          • Phishing
          • Resource Exploitation
        • Post-Compromise Recon
          • AWS Command Line
          • Resource Enumeration
          • IAM Policy Enumeration
          • Identifying Public Resources
        • S3 Buckets
          • S3 Bucket Misconfiguration
      • 🅰️Azure Pentesting
        • Azure Attack Matrix
        • Stealing Access Tokens
        • Lateral Movement - Skeleton Key Attack
    • 🪟Windows Security
      • 🕵️‍♂️Recon
        • Host Discovery
        • SMB
        • MSSQL
        • IIS
      • 🦹Exploitation
        • CMD Commands
      • 🚪Post Exploitation
        • Dump Password Hashes
        • Mimikatz
      • 🦕Persistence (Post)
        • User Accounts, Hash Cracking, RID Hijacking
        • Backdoors
        • Services
        • Scheduled Tasks
        • Windows Startup
    • 🐧Linux Security
      • 🏋️‍♂️Privilege Escalation
        • 1️⃣1⃣ 1⃣ Exploiting Setuid Programs
        • 2️⃣2⃣ 2⃣ Cron Jobs
        • 3️⃣3⃣ 3⃣ Permissions
        • 4️⃣4⃣ 4⃣ Logs
        • 5️⃣5⃣ 5⃣ Restricted Shell
      • Persistence
        • D3m0n1z3dShell
    • 🍎MacOS Security
      • Endpoint Security
        • eslogger
      • Gaining Access
        • Setup and weaponize Mythic C2 using DarwinOps to target MacOS
    • 📱Android Security
      • Android Pentesting Notes
      • Android Application Pentesting Part 1
        • Static Analysis
        • Dynamic Analysis
      • Android Application Pentesting Part 2
        • Aspects of Android Security
        • Static Application Testing
        • Dynamic Application Testing - Part 1
        • Platform Interaction Testing
        • Dynamic Application Testing - Part 2
        • OWASP Top 10
      • Mobile Application Pentesting Part 3
        • Mobile Security Controls
        • Dynamic Analysis
        • Static Code Analysis
        • Insecure Data Storage
        • Runtime Security
    • 🍎iOS Security
      • iOS Application Analysis
    • 🧾Scripting
      • 💎Ruby
        • Basics
        • Object Types
      • 🐍Python
        • Web Scrapping Scripts
      • 🐧Bash
      • 🐪Perl
      • 🐘PHP
    • 🐉Reverse Engineering & Malware Analysis
      • RE Preparation
        • RE Process
        • Malware Analysis Tools
        • Malware Components: Windows
      • Shellcode Analysis
        • Automated Extraction
      • 1️⃣Disassembly and Disassembler
      • 2️⃣Binary Analysis
      • 🐧Linux ELF Format
      • ♎Yara Guide
      • 📱Android Reverse Engineering
        • Spyware Reverse Engineering
      • 📲Mobile Applications
        • Flutter Mobile Apps
    • 🌠Protocol Exploitation
      • ARP
      • DNS
      • VoIP
    • 🛜Network Pentesting
      • SNMP - Authentification
    • 👮Digital Forensics & Incident Response
      • 📩Email Forensics
        • Callback Phishing
        • Business Email Compromise Investigations
          • Investigating using Hawk
          • Microsoft Defender Explorer
      • 💸Ransomware Forensics
        • Decrypting Intermittent Encryption
      • 💱Blockchain Forensics
        • 🍾Frontrunning/Sandwich Bot Finder
      • 📝Memory Forensics
        • Process
        • Memory Analysis - Volatility3
      • ☄️Network Forensics
        • Pcap Analysis
      • 🪟Windows Forensics
        • NTDS Secret Extraction
        • Detecting Hidden Processes
        • Analyzing Prefetch Files
        • Windows MFT Parsing
        • USN Journal Forensics
      • 📼Media Forensics
        • Rubber Ducky Analysis
        • RDP Bitmap Cache
        • USB Event Tracking
      • 🧙Forensic Imaging
        • Image Analysis: Autopsy
      • 🪅Data Collection
        • 🪟Windows
        • 🐧Unix/Linux
      • 🔏Privacy Research
        • Deanonymization - TOR Hidden Services
        • Deanonymization - Flash Code
        • Dark Web - OSINT
        • Dark Web Investigation
      • 🕸️Web Investigations
        • Investigating Favicon Hashes
      • 🏴‍☠️Threat Detection
        • Reading Clipboard Data via Powershell
        • Detection of Windows Defender Tampering via Powershell
        • Detection of Remote Template Injection
    • 🦋Cisco Attacks
      • Decrypting Type 5 Cisco Passwords
    • 🐼CVE's
      • libssh 0.8.1 - CVE 2018-10933
      • proftpd-1.3.3c-backdoor
      • zerologon - CVE-2020-1472
      • Apache Ghostcat - CVE 2020-1938
      • Spring Authorization Bypass - CVE 2024-38821
      • Apache Solr - CVE-2024-45216
      • Bypassing Mark of the Web with 7zip CVE-2025-0411
      • CVE-2025-24054, NTLM Exploit in the Wild
    • 🐛OWASP TOP 10
      • LLM
        • OWASP Top 10 for LLM Applications
      • Machine Learning
        • OWASP Machine Learning Security Top Ten
      • 🕸️WEB
        • 1️⃣A01:2021 – Broken Access Control
        • 2️⃣A02:2021 – Cryptographic Failures
        • 3️⃣A03:2021 – Injection
        • 4️⃣A04:2021 – Insecure Design
        • 5️⃣A05:2021 – Security Misconfiguration
        • 6️⃣A06:2021 – Vulnerable and Outdated Components
        • 7️⃣A07:2021 – Identification and Authentication Failures
        • 8️⃣A08:2021 – Software and Data Integrity Failures
        • 9️⃣A09:2021 – Security Logging and Monitoring Failures
        • 🔟A10:2021 – Server-Side Request Forgery (SSRF)
      • 🦄API
      • 🌆IoT
      • 📱MOBILE
    • 🛼Web 3 Vulnerabilities
      • Fuzzing Ethereum Smart Contract
      • Static Analysis using Slither
      • Solidity Audit using Mythril
      • 🎆Reentrancy Vulnerabilities
      • 🥪Sandwich Attacks
      • 🌇Integer Attacks
      • 🚂Authorization Issues
      • 🌉Bad Randomness
    • 🛩️Web 3 Smart Contract
      • ⛎Blockchain Hacking (Python)
        • 🌆Smart Contract Template
        • 🎆Interact with ERC20 Tokens
        • 📲Interact with Wallets
        • 🍷Reverse Engineering Bytecode
        • ✒️Sign Transactions
        • 🪢Smart Contract Interactions
        • 🧜‍♀️Subscribing to Events
        • 🟤Brownie Interactions
        • 👾Exploit PoC
    • 🌃Smart Contract Audits
      • 🐸Thunder Loan Audit
        • 1️⃣Initial Review
    • 👩‍💼GRC Frameworks
      • NIST 800-39
      • SOC 2
      • HIPAA
      • PCI-DSS
      • NIST CSF
      • FedRAMP
      • CSA STAR
      • SOX
      • GDPR
      • ISO 27001
  • 🦹REAL WORLD && CTF
    • ⚛️Scripts and Systems
      • R: Code Execution
      • Python2 Input Vulnerability
  • 🦸MISCELLANEOUS
    • Decrypt SSL Traffic
    • 🏦OpenSSL Commands
    • 🔒GPG
    • 🔐SSH Commands
    • OWASP BWAPP Setup
    • Commando VM Setup
    • Living Off The Land Applications
    • 🐧Develop Your Own Linux Distro
    • 🐱GitHub Commands
      • 📔Cheatsheet
  • 🧛‍♂️ADVANCED PERSISTENT THREATS - RESEARCH
    • Reconnaissance
    • Resource Development
    • Initial Compromise
    • Execution
    • Establish persistence
    • Escalate privileges
    • Defense Evasion
    • Credential Access
    • Discovery
    • Lateral movement
    • Collection
    • Command and Control
    • Data exfiltration
    • Impact
  • 👾THREAT HUNTING - RESEARCH
    • MacOS
    • Azure Sentinel
    • Network Data
      • Network Data Sources
      • Network Threat Hunting Too
      • Hunting the Undetected
      • Protocols
      • Network Threat Hunts
    • Active Directory
      • Introduction
      • Threat Hunting
      • Threat Hunting in Active Directory
    • Data Collection
      • Internal Data
      • External Data
        • Private Data Sources
        • Community Data Sources
        • Public Data Sources
      • OSINT
    • Data Management and Processing
      • Data Processing
      • Common CTI Standards
      • Storage and Integration
      • Threat Intelligence Platforms
    • Analysis
      • Introduction
      • Analysis of Competing Hypothesis
      • Cyber Kill Chain and Diamond Model
      • Cyber Kill Chain and Courses of Action
    • Campaign Analysis
      • Introduction
      • Heatmap Analysis
      • Visual Analysis
      • MITRE Threat Group Tracker
      • Threat Intelligence Naming Conventions
    • Attribution
      • Introduction
      • Cognitive Biases
      • Logical Fallacies
      • Manage Biases
      • Nation-State Attribution
    • Dissemination and Sharing
      • Introduction
      • Tactical Intelligence
      • Operational Intelligence
      • Strategic Intelligence
  • 🦅CISA - INCIDENT RESPONSE PLAYBOOK
    • Overview
Powered by GitBook
On this page
  • JWT header parameter injections
  • Injecting self-signed JWTs via the jwk parameter
  • Lab
  • Injecting self-signed JWTs via the jku parameter
  • Lab
  • Steps
  • Injecting self-signed JWTs via the kid parameter
  • Lab
  • Steps
  • Other interesting JWT header parameter

Was this helpful?

Edit on GitHub
  1. CS && PEN-TESTING BOOK
  2. Web App Pentesting Notes
  3. JWT Attack

JWT header parameter injections

JWT header parameter injections

According to the JWS specification, only the alg header parameter is mandatory. In practice, however, JWT headers (also known as JOSE headers) often contain several other parameters. The following ones are of particular interest to attackers.

  • jwk (JSON Web Key) - Provides an embedded JSON object representing the key.

  • jku (JSON Web Key Set URL) - Provides a URL from which servers can fetch a set of keys containing the correct key.

  • kid (Key ID) - Provides an ID that servers can use to identify the correct key in cases where there are multiple keys to choose from. Depending on the format of the key, this may have a matching kid parameter.

Injecting self-signed JWTs via the jwk parameter

The JSON Web Signature (JWS) specification describes an optional jwk header parameter, which servers can use to embed their public key directly within the token itself in JWK format.

JWK

A JWK (JSON Web Key) is a standardized format for representing keys as a JSON object.

You can see an example of this in the following JWT header:

{
    "kid": "ed2Nf8sb-sD6ng0-scs5390g-fFD8sfxG",
    "typ": "JWT",
    "alg": "RS256",
    "jwk": {
        "kty": "RSA",
        "e": "AQAB",
        "kid": "ed2Nf8sb-sD6ng0-scs5390g-fFD8sfxG",
        "n": "yy1wpYmffgXBxhAUJzHHocCuJolwDqql75ZWuCQ_cb33K2vh9m"
    }
}

Ideally, servers should only use a limited whitelist of public keys to verify JWT signatures. However, misconfigured servers sometimes use any key that's embedded in the jwk parameter.

You can exploit this behavior by signing a modified JWT using your own RSA private key, then embedding the matching public key in the jwk header.

  1. With the extension loaded, in Burp's main tab bar, go to the JWT Editor Keys tab.

  2. Send a request containing a JWT to Burp Repeater.

  3. Click Attack, then select Embedded JWK. When prompted, select your newly generated RSA key.

  4. Send the request to test how the server responds.

You can also perform this attack manually by adding the jwk header yourself. However, you may also need to update the JWT's kid header parameter to match the kid of the embedded key. The extension's built-in attack takes care of this step for you.

Lab

This lab uses a JWT-based mechanism for handling sessions. The server supports the jwk parameter in the JWT header. This is sometimes used to embed the correct verification key directly in the token. However, it fails to check whether the provided key came from a trusted source.

To solve the lab, modify and sign a JWT that gives you access to the admin panel at /admin, then delete the user carlos.

You can log in to your own account using the following credentials: wiener:peter

Steps

Get the JWT Token

  • Install JWT Editor extension in burp suite

  • Visit the website and login as wiener and password as peter

  • send the request which contains the jwt token to repeater

Sign and generate RSA key

  • Go to the JWT Editor Keys tab.

  • Generate a new RSA key

  • In the repeater tab change the sub value to administrator in the payload section

  • Click on the Attack button

  • Click on Ok

  • Now copy the newly created JWT Token

Delete the user Carlos

  • Now, visit the /admin route and send the request to repeater

  • Replace the old JWT with the New one and send the request

  • In the proxy tab replace the old jwt with the new one and forward the request

  • $$$

Injecting self-signed JWTs via the jku parameter

Instead of embedding public keys directly using the jwk header parameter, some servers let you use the jku (JWK Set URL) header parameter to reference a JWK Set containing the key. When verifying the signature, the server fetches the relevant key from this URL.

JWK Set

A JWK Set is a JSON object containing an array of JWKs representing different keys. You can see an example of this below.

{
    "keys": [
        {
            "kty": "RSA",
            "e": "AQAB",
            "kid": "75d0ef47-af89-47a9-9061-7c02a610d5ab",
            "n": "o-yy1wpYmffgXBxhAUJzHHocCuJolwDqql75ZWuCQ_cb33K2vh9mk6GPM9gNN4Y_qTVX67WhsN3JvaFYw-fhvsWQ"
        },
        {
            "kty": "RSA",
            "e": "AQAB",
            "kid": "d8fDFo-fS9-faS14a9-ASf99sa-7c1Ad5abA",
            "n": "fc3f-yy1wpYmffgXBxhAUJzHql79gNNQ_cb33HocCuJolwDqmk6GPM4Y_qTVX67WhsN3JvaFYw-dfg6DH-asAScw"
        }
    ]
}

JWK Sets like this are sometimes exposed publicly via a standard endpoint, such as /.well-known/jwks.json.

Lab

This lab uses a JWT-based mechanism for handling sessions. The server supports the jku parameter in the JWT header. However, it fails to check whether the provided URL belongs to a trusted domain before fetching the key.

To solve the lab, forge a JWT that gives you access to the admin panel at /admin, then delete the user carlos.

You can log in to your own account using the following credentials: wiener:peter

Steps

Get the JWT Token

  • Install JWT Editor extension in burp suite

  • Visit the website and login as wiener and password as peter

  • send the request which contains the jwt token to repeater

generate RSA key

  • Go to the JWT Editor Keys tab.

  • Generate a new RSA key

Upload the JWK key to Exploit server

{ "keys": 
  [
     {
        "kty": "RSA",
        "e": "AQAB",
        "kid": "a68d162b-2995-43e7-9e6e-e23d5eead1ec",
        "n": "pbt7QL5_F4PviT21LF8FYC1kTYz40bgzqdtc6Ioha2kOeE0CNnQr9ruEHR2E5rAmzkkKavOoMydXdb_X4epVC-9wSvni-S_wyYlhO1eRSner3uLzDh0ZWZUcuaFVNa4nuIKixc3bQh-DxH5AsYJ1De80-q7wAWTNkkVjIXmLz8ePXzrvbXZAO_YHKgkFEGJQzNSBCp9Sy2eKhpI-1b-Nqngt2NIeu7EiOK9VzwjJXgArouqsHP_PV_S3jP2oepHKSZupz1AfrEjU5mjsUXxg9_p9IJ3XeGynyCz_YbCwGLN7ZHfaAUgs5_bfsmc1zog-HwYK17RKSsOqR_P1LvPotQ"
     }
  ]
}
  • Now copy the given url from exploit server.

Sign the add jku parameter

  • add jku paramter with the given exploit server url in the header section

  • Change the sub value in Payload tab to administrator

  • Click on the sign button

  • Select Update/Generate "alg", "typ", and "kid" parameters

  • Click Ok

  • Copy the new JWT

Delete the user Carlos

  • Now, visit the /admin route and send the request to repeater

  • Replace the old JWT with the New one and send the request

  • In the proxy tab replace the old jwt with the new one and forward the request

  • $$$

Injecting self-signed JWTs via the kid parameter

Servers may use several cryptographic keys for signing different kinds of data, not just JWTs. For this reason, the header of a JWT may contain a kid (Key ID) parameter, which helps the server identify which key to use when verifying the signature.

Verification keys are often stored as a JWK Set. In this case, the server may simply look for the JWK with the same kid as the token. However, the JWS specification doesn't define a concrete structure for this ID - it's just an arbitrary string of the developer's choosing. For example, they might use the kid parameter to point to a particular entry in a database, or even the name of a file.

{
    "kid": "../../path/to/file",
    "typ": "JWT",
    "alg": "HS256",
    "k": "asGsADas3421-dfh9DGN-AFDFDbasfd8-anfjkvc"
}

You could theoretically do this with any file, but one of the simplest methods is to use /dev/null, which is present on most Linux systems. As this is an empty file, reading it returns an empty string. Therefore, signing the token with a empty string will result in a valid signature.

If you're using the JWT Editor extension, note that this doesn't let you sign tokens using an empty string. However, due to a bug in the extension, you can get around this by using a Base64-encoded null byte.

Lab

This lab uses a JWT-based mechanism for handling sessions. In order to verify the signature, the server uses the kid parameter in JWT header to fetch the relevant key from its filesystem.

To solve the lab, forge a JWT that gives you access to the admin panel at /admin, then delete the user carlos.

You can log in to your own account using the following credentials: wiener:peter

Steps

  • Install JWT Editor in burp suite

  • Visit the website and login as wiener:peter

  • Visit the /admin route and send the request to repeater

  • Now, generate a new symmetric key by clicking on the JWT Editor Tab

  • Select Specify secret option and click on generate

  • In the below section change the "k" value to "AA==" which is base64 null byte

  • Click Ok

  • In the repeater tab select the JSON Web Token tab

  • Change the kid value to "../../../.../../dev/null"

  • Change the sub value to administrator

  • Click on the Sign button and click Ok

  • Copy the newly generate JWT value

  • Visit the /admin/delete?username=carlos route

  • In the proxy tab change the JWT value to the new JWT value

  • Forward the request

  • $$$

Other interesting JWT header parameter

The following header parameters may also be interesting for attackers:

PreviousBrute-forcing secret keysNextPrevent JWT attacks

Last updated 1 year ago

Was this helpful?

Although you can manually add or modify the jwk parameter in Burp, the provides a useful feature to help you test for this vulnerability:

In the message editor, switch to the extension-generated JSON Web Token tab and the token's payload however you like.

Now, visit

More secure websites will only fetch keys from trusted domains, but you can sometimes take advantage of URL parsing discrepancies to bypass this kind of filtering. We covered some in our topic on .

Now, visit

If this parameter is also vulnerable to , an attacker could potentially force the server to use an arbitrary file from its filesystem as the verification key.

This is especially dangerous if the server also supports JWTs signed using a . In this case, an attacker could potentially point the kid parameter to a predictable, static file, then sign the JWT using a secret that matches the contents of this file.

If the server stores its verification keys in a database, the kid header parameter is also a potential vector for attacks.

cty (Content Type) - Sometimes used to declare a media type for the content in the JWT payload. This is usually omitted from the header, but the underlying parsing library may support it anyway. If you have found a way to bypass signature verification, you can try injecting a cty header to change the content type to text/xml or application/x-java-serialized-object, which can potentially enable new vectors for and attacks.

x5c (X.509 Certificate Chain) - Sometimes used to pass the X.509 public key certificate or certificate chain of the key used to digitally sign the JWT. This header parameter can be used to inject self-signed certificates, similar to the attacks discussed above. Due to the complexity of the X.509 format and its extensions, parsing these certificates can also introduce vulnerabilities. Details of these attacks are beyond the scope of these materials, but for more details, check out and .

👽
🕸️
💎
JWT Editor extension
Generate a new RSA key.
modify
https://0aa3003a030a51f18174f88b00e1004d.web-security-academy.net/admin/delete?username=carlos
examples of these
SSRF
https://0aa3003a030a51f18174f88b00e1004d.web-security-academy.net/admin/delete?username=carlos
directory traversal
symmetric algorithm
SQL injection
XXE
deserialization
jwk header injection
CVE-2017-2800
CVE-2018-2633
Lab: JWT authentication bypass via jwk header injection | Web Security AcademyWebSecAcademy
Logo
Lab: JWT authentication bypass via jku header injection | Web Security AcademyWebSecAcademy
Logo
Lab: JWT authentication bypass via kid header path traversal | Web Security AcademyWebSecAcademy
Logo