Security Vulnerability Report
中文
CVE-2025-15604 CVSS 9.8 CRITICAL

CVE-2025-15604

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

Description

Amon2 versions before 6.17 for Perl use an insecure random_string implementation for security functions. In versions 6.06 through 6.16, the random_string function will attempt to read bytes from the /dev/urandom device, but if that is unavailable then it generates bytes by concatenating a 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. Before version 6.06, there was no fallback when /dev/urandom was not available. Before version 6.04, the random_string function used the built-in rand() function to generate a mixed-case alphanumeric string. This function may be used for generating session ids, generating secrets for signing or encrypting cookie session data and generating tokens used for Cross Site Request Forgery (CSRF) protection.

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:tokuhirom:amon2:*:*:*:*:*:perl:*:* - VULNERABLE
Amon2 < 6.17
Amon2 6.06 - 6.16
Amon2 < 6.06

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# PoC: Perl script simulating the vulnerable random string generation logic # This demonstrates how the fallback mechanism uses weak entropy sources. use strict; use warnings; use Digest::SHA qw(sha1_hex); use Time::HiRes qw(time); # Simulate the vulnerable function in Amon2 < 6.17 sub vulnerable_random_string { my ($length) = @_; # Weak entropy sources: built-in rand, PID ($$), and time # In a real attack, these values can be guessed or brute-forced my $weak_seed = int(rand(2**32)) . $$ . Time::HiRes::time(); # Generate hash from weak seed my $hash = sha1_hex($weak_seed); # Return truncated string return substr($hash, 0, $length); } # Example usage print "[+] Generating vulnerable token...\n"; my $token = vulnerable_random_string(10); print "[+] Token: $token\n"; print "[!] Note: This token is predictable if PID and Time are known.\n";

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-15604", "sourceIdentifier": "9b29abf9-4ab0-4765-b253-1875cd9b441e", "published": "2026-03-28T19:16:53.387", "lastModified": "2026-04-01T15:16:23.170", "vulnStatus": "Modified", "cveTags": [], "descriptions": [{"lang": "en", "value": "Amon2 versions before 6.17 for Perl use an insecure random_string implementation for security functions.\n\nIn versions 6.06 through 6.16, the random_string function will attempt to read bytes from the /dev/urandom device, but if that is unavailable then it generates bytes by concatenating a 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\nBefore version 6.06, there was no fallback when /dev/urandom was not available.\n\nBefore version 6.04, the random_string function used the built-in rand() function to generate a mixed-case alphanumeric string.\n\nThis function may be used for generating session ids, generating secrets for signing or encrypting cookie session data and generating tokens used for Cross Site Request Forgery (CSRF) protection."}, {"lang": "es", "value": "Las versiones de Amon2 anteriores a la 6.17 para Perl utilizan una implementación insegura de random_string para funciones de seguridad.\n\nEn las versiones 6.06 a la 6.16, la función random_string intentará leer bytes del dispositivo /dev/urandom, pero si este no está disponible, entonces genera bytes concatenando un hash SHA-1 inicializado con la función rand() incorporada, el PID y el tiempo de época de alta resolución. 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 no es adecuada para uso criptográfico.\n\nAntes de la versión 6.06, no había un mecanismo de respaldo cuando /dev/urandom no estaba disponible.\n\nAntes de la versión 6.04, la función random_string utilizaba la función rand() incorporada para generar una cadena alfanumérica de mayúsculas y minúsculas.\n\nEsta función puede ser utilizada para generar IDs de sesión, generar secretos para firmar o cifrar datos de sesión de cookie y generar tokens utilizados para la protección contra la falsificación de solicitudes entre sitios (CSRF)."}], "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:tokuhirom:amon2:*:*:*:*:*:perl:*:*", "versionEndExcluding": "6.17", "matchCriteriaId": "0920218A-C374-46FB-A8C8-FC92ACFB73DB"}]}]}], "references": [{"url": "https://github.com/tokuhirom/Amon/pull/135", "source": "9b29abf9-4ab0-4765-b253-1875cd9b441e", "tags": ["Issue Tracking", "Patch"]}, {"url": "https://metacpan.org/release/TOKUHIROM/Amon2-6.17/changes", "source": "9b29abf9-4ab0-4765-b253-1875cd9b441e", "tags": ["Product"]}, {"url": "https://metacpan.org/release/TOKUHIROM/Amon2-6.17/diff/TOKUHIROM/Amon2-6.16#lib/Amon2/Util.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/4", "source": "af854a3a-2127-422b-91ae-364da2661108", "tags": ["Mailing List", "Third Party Advisory"]}]}}