
Proof-of-concept for CVE-2022-45782: predictable dotCMS password-reset tokens, with a token cracker and full exploit chain.
This repository contains a proof-of-concept exploit for CVE-2022-45782, a vulnerability in dotCMS where password-reset tokens are generated using the non-cryptographic method RandomStringUtils.randomAlphanumeric(). Because this token is predictable, an attacker can brute-force or derive it and reset the password of an administrator account.
This PoC demonstrates the full exploit chain:
This repo uses a Git submodule containing the cracker for the vulnerable token-generation function. It is the C implementation of the cracker used to derive/guess password-reset tokens generated by RandomStringUtils.randomAlphanumeric().
Clone with submodule:
git clone https://github.com/alex91ar/randomstringutils.git
dotCMS must send reset emails for the PoC to work.
Edit docker-compose.yml:
DOT_MAIL_SMTP_USER: "<smtp_email>"
DOT_MAIL_SMTP_PASSWORD: "<smtp_pass>"
(If using Gmail: enable App Password and use the generated 16-character app password.)
docker compose up
If it fails (common on first startup), simply run again.
Login page: https://localhost:8443/dotAdmin/#/public/login
Inside dotCMS:
These two accounts will be used by the PoC.
randomstringutils is the brute-forcer/cracker for dotCMS’s insecure token.
Compile it using:
cd randomstringutils
gcc -lpthread -O3 -o randomutils randomutils.c
This produces the fast token-cracker binary.
python3 poc.py
If successful, the script uses the cracked admin token to reset the admin account.
This repository is for educational, academic, and authorized security testing only. Do NOT use this exploit against systems you do not own or have explicit permission to test.