/

CVE-2026-31940

Severity:

HIGH RISK

(7.5)

Session Management Vulnerability in Chamilo LMS AICC HACP

CVE-2026-31940

Analyzed

Vulnerability type

Category:

Session Management Vulnerability

CWE:

CWE-384

Impact:

Session Hijacking / Account Compromise

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Chamilo LMS contains a session fixation vulnerability where user-controlled request parameters are directly used to set the PHP session ID in main/lp/aicc_hacp.php before the global bootstrap is loaded.

Under certain conditions, this allows an attacker to force a victim's browser to use an attacker-chosen session identifier, potentially hijacking the victim's authenticated session once they log in.

Affected context

The issue occurs in Chamilo LMS within the AICC HACP (HTTP AICC Communication Protocol) handling script main/lp/aicc_hacp.php.

It is relevant when:

  • The application allows clients to influence or set the PHP session ID via request parameters.
  • Session initialization happens before robust validation or regeneration of the session ID.
  • Users subsequently authenticate while using a pre-fixed session, which may be controlled by an attacker.

Exploit preconditions

  • Attack surface: Web interface, specifically the AICC HACP endpoint in Chamilo LMS.
  • Required access: Ability to send crafted HTTP requests and induce a victim to use a provided link, embedded resource, or integration that sets the session ID parameter.
  • Trigger point: The moment the AICC HACP handler initializes the PHP session using the attacker-controlled session ID prior to global bootstrap and any defensive session management.
  • Why exploitation is possible: The code trusts a request parameter as the session identifier, failing to regenerate or randomize it on login, enabling an attacker to predefine the session state that a victim will later use for authentication.

Why this happens

This vulnerability stems from insecure session ID management, where the application allows external input to directly control the server-side session identifier.

Mapping to CWE-384: Session Fixation, the bug class is:

  • Accepting a client-supplied value as the session ID.
  • Initializing the PHP session with that value before applying security checks or regenerating the ID upon changes in privilege (e.g., login).

In secure designs, the server exclusively generates and rotates session identifiers, never trusting user input to dictate session identity, especially around authentication transitions.

Potential impact

  • An attacker could fix a known session ID and later hijack a user's authenticated session associated with that ID.
  • Unauthorized access to user accounts, including access to course materials, grades, and personal data depending on Chamilo configuration.
  • Escalation of privileges if targeted accounts have elevated roles such as teacher or administrator.
  • Compromise of confidentiality and integrity of learning records and user information tied to affected sessions.

General mitigation guidance

Effective mitigation focuses on secure session lifecycle management rather than ad hoc checks around specific parameters.

Recommended patterns include:

  • Ensuring session IDs are always generated and controlled solely by the server's session mechanism, never derived from user input.
  • Regenerating session identifiers on key transitions (e.g., login, privilege escalation) so pre-existing IDs cannot be reused to gain higher privileges.
  • Disallowing any request parameter, cookie override, or URL token from being used directly as the PHP session ID.
  • Applying a strict policy that treats session identifiers as opaque, high-entropy secrets, and validating that integrations (such as AICC HACP) do not circumvent default session handling.
  • Minimizing session lifetime and employing inactivity timeouts to reduce the window in which a fixed session can be abused.

How teams detect issues like this

Detection generally involves reviewing session handling logic and integration endpoints rather than only scanning for known CVEs.

Useful approaches include:

  • Static code analysis to flag any usage where session IDs are set or overridden from request parameters (e.g., direct manipulation of session_id() using $_GET or $_POST data).
  • Code review checklists that explicitly ask whether any part of the application allows clients to specify or override the session identifier.
  • Automated tests or dynamic analysis that attempt to set the session ID via query parameters or form fields and verify whether the value is honored by the server.
  • Security policies and CI checks that disallow custom session-ID handling outside centralized, vetted session management utilities.

Sources

SourceLink
github.comgithub.com/chamilo/chamilo-lms/commit/ce0192c62e48c9d9474d915c541b3274844afbf9
github.comgithub.com/chamilo/chamilo-lms/commit/e337b7cc74a0276a0b4f91f9282204d20cac1869
github.comgithub.com/chamilo/chamilo-lms/security/advisories/GHSA-4gp7-cfjh-77gv

Frequently asked

questions

Yes. An attacker can exploit this remotely by crafting links or requests that set a chosen session ID and convincing victims or integrated systems to interact with the application using that session, especially around login.

The attacker does not need to be authenticated initially. They typically predefine a session ID for an unauthenticated user, then wait for the victim to authenticate under that fixed session, at which point the attacker can reuse the same session ID to access the victim's account.

The safest pattern is to prevent any user input from influencing the session ID, centralize session handling in the framework or platform's standard mechanisms, and always regenerate the session identifier on authentication or privilege changes.

Adopt a secure session management strategy: treat session IDs as server-only secrets, forbid manual overrides from request parameters, enforce session regeneration on login, and include explicit session-handling checks in security reviews and automated testing for all new endpoints and integrations.

Find out what's already
exploitable in your codebase.