CVE-2025-40931
Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.
NVD · uneditedApache::Session::Generate::MD5 versions through 1.94 for Perl create insecure session id. Apache::Session::Generate::MD5 generates session ids insecurely. The default session id generator returns a MD5 hash seeded with the built-in rand() function, the 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. Predicable session ids could allow an attacker to gain access to systems. Note that the libapache-session-perl package in some Debian-based Linux distributions may be patched to use Crypt::URandom.
Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.
dbcve analysis · high confidenceThe Apache::Session::Generate::MD5 Perl module generates session IDs using an insecure combination of the built-in rand() function (cryptographically weak), epoch time, and process ID. Since rand() is unsuitable for security, the PID comes from a small space, and epoch time may be guessable from HTTP headers, an attacker can predict valid session IDs and hijack user sessions.
Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.
Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.
NVD · CPE data<= 1.94CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.
From the vector- Attack vector
- Network
- Complexity
- Low
- Privileges
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- None
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.
dbcve checksWork through these to decide whether this CVE applies to you.
-
Identify if Apache::Session::Generate::MD5 is installedRun `perl -MApache::Session::Generate::MD5 -e 'print $Apache::Session::Generate::MD5::VERSION'` to check the installed versionAffected if The module version is 1.94 or lower
-
Locate Perl application files using Apache::SessionSearch project files for 'use Apache::Session' or 'use Apache::Session::Generate::MD5' statements, or look for session configuration files that reference this moduleAffected if The application imports or configures Apache::Session::Generate::MD5 for session handling
-
Examine session ID generation configurationReview application code or configuration to determine which generator is assigned to the session store, typically in a hash passed to Apache::Session::tie() with a 'Generate' key set to Apache::Session::Generate::MD5Affected if The session configuration explicitly specifies Apache::Session::Generate::MD5 as the generator
-
Inspect session ID format if accessibleIf you can obtain a session ID from the application, examine whether it follows the predictable pattern of MD5(rand output + time + PID) - however this is difficult to verify without source code reviewAffected if The application uses the default Apache::Session::Generate::MD5 for session ID generation (direct observation of ID format alone is not definitive)
If Apache::Session::Generate::MD5 version 1.94 or lower is installed and configured as the session ID generator in the application, the environment is affected by this vulnerability.
Generated from the published advisory. Verify against your own configuration.
Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.
dbcve · scopedReplace the default session ID generator with a cryptographically secure random source such as Crypt::URandom, and implement a session invalidation/migration strategy to transition existing sessions to the new secure format.
Apache::Session::Generate::MD5 version > 1.94 (e.g., 1.95 or later)
- Identify all Perl applications using Apache::Session::Generate::MD5 version 1.94 or earlier
- Stop any running services that use the affected module
- Install the updated version of Apache::Session::Generate::MD5 (version > 1.94) using your Perl package manager
- For cpanm: cpanm Apache::Session::Generate::MD5
- For cpan: cpan Apache::Session::Generate::MD5
- Verify the new version is installed: perl -MApache::Session::Generate::MD5 -e 'print $Apache::Session::Generate::MD5::VERSION'
- Restart affected services to load the new module
- If using Debian's libapache-session-perl package, ensure it includes the Crypt::URandom patch by checking: dpkg -s libapache-session-perl
Generated from the published advisory — verify against the referenced sources before acting.
- Consultation4.0 h
- Implementation8.0 h
- Testing6.0 h
- Review / QA3.0 h
An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $5,888.
Scan for this in your stack
Free · runs locallyCheck whether your project pulls in CVE-2025-40931 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.
References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.
Primary sourcesPractitioner notes
ContributedPeer-ranked notes from engineers who’ve handled CVE-2025-40931 in production — separate from our analysis above.
The advisory tells you what broke. It rarely tells you what actually worked. If you’ve dealt with this one, that detail is what the next engineer is searching for.
- The version that genuinely resolved it — not the one the vendor claimed
- A config change or rule that shut the vector down
- A gotcha in the upgrade path that cost you an afternoon
No notes yet
Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.
A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.
- Verified mitigations, workarounds, and config changes
- Version or environment caveats, and links to real fixes
- No weaponised exploit code, or anything meant to cause harm
- No spam, self-promotion, credentials, or personal data