CVE-2018-25160
Received Received - Intake
Session ID Injection in HTTP::Session2 Allows Remote Code Execution

Publication date: 2026-02-27

Last updated on: 2026-03-18

Assigner: CPANSec

Description
HTTP::Session2 versions through 1.09 for Perl does not validate the format of user provided session ids, enabling code injection or other impact depending on session backend. For example, if an application uses memcached for session storage, then it may be possible for a remote attacker to inject memcached commands in the session id value.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2026-02-27
Last Modified
2026-03-18
Generated
2026-05-07
AI Q&A
2026-02-27
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
tokuhirom http to 1.09 (inc)
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-20 The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

HTTP::Session2 versions through 1.09 for Perl do not validate the format of user-provided session IDs. This lack of validation allows an attacker to supply specially crafted session IDs that can lead to code injection or other impacts depending on the session backend used.

For example, if the application uses memcached for session storage, a remote attacker could inject memcached commands through the session ID value, potentially manipulating the session storage.

A patch was introduced to add strict validation of session IDs, rejecting those containing control characters, non-ASCII bytes, or those exceeding a certain length, thereby preventing malicious session identifiers from being processed.


How can this vulnerability impact me? :

This vulnerability can allow a remote attacker to inject malicious commands into the session backend if it does not properly handle unsafe session IDs.

In scenarios where memcached is used for session storage, an attacker could exploit this flaw to execute memcached commands via the session ID, potentially leading to unauthorized data manipulation or denial of service.

Overall, the impact depends on the session backend, but it could result in code injection, data corruption, or other security breaches related to session management.


How does this vulnerability affect compliance with common standards and regulations (like GDPR, HIPAA)?:

I don't know


How can this vulnerability be detected on my network or system? Can you suggest some commands?

[{'type': 'paragraph', 'content': 'This vulnerability involves improper validation of user-provided session IDs in HTTP::Session2, which can lead to code injection depending on the session backend.'}, {'type': 'paragraph', 'content': 'Detection can focus on identifying session IDs containing control characters (ASCII 0x00-0x20), DEL (0x7f), non-ASCII bytes (0x80-0xff), or unusually long session IDs exceeding 40 characters.'}, {'type': 'paragraph', 'content': 'You can monitor HTTP traffic or logs for session cookies with suspicious or malformed session ID values matching these criteria.'}, {'type': 'list_item', 'content': 'Use tools like tcpdump or Wireshark to capture HTTP traffic and filter for session cookies.'}, {'type': 'list_item', 'content': 'Example command to capture HTTP cookies containing suspicious characters (using tcpdump and grep):'}, {'type': 'list_item', 'content': "tcpdump -A -s 0 'tcp port 80' | grep -i 'Cookie:' | grep -P '[\\x00-\\x20\\x7f-\\xff]'"}, {'type': 'list_item', 'content': 'Alternatively, inspect application logs or session stores for session IDs longer than 40 characters or containing invalid characters.'}] [1]


What immediate steps should I take to mitigate this vulnerability?

The primary mitigation is to apply the patch that adds strict validation of session IDs in HTTP::Session2, rejecting any session ID containing control characters, DEL, non-ASCII bytes, or exceeding 40 characters in length.

If you use memcached for session storage, consider using a memcached client module that sanitizes keys to prevent injection attacks, such as Cache::Memcached::Fast::Safe.

  • Update HTTP::Session2 to a version including the patch that enforces session ID validation.
  • Review and sanitize session ID inputs in your application to ensure they conform to expected formats.
  • If applicable, switch to or configure memcached clients that sanitize keys to prevent injection, like Cache::Memcached::Fast::Safe.
  • Monitor session handling logs for any suspicious activity or malformed session IDs.

Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart