Recently, I faced a weird problem after flashing a leaked firmware on my Galaxy S2. Just after the booting, a Confirm Password would lock my device which did not even accept the correct password, leaving me virtually disabled.
Further, attempting more than 4 wrong would wipe out my SD card. The recovery mode was also blocked so formatting the phone was definitely not in my options list. But thankfully, after playing for few minutes, I finally freed myself from this problem.