/

CVE-2026-61532

Severity:

CRITICAL RISK

(9.0)

Path Traversal (CWE-22) in Chamilo LMS Course Restore

CVE-2026-61532

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22, CWE-73, CWE-94

Impact:

Arbitrary File Write and Potential Code Execution

Severity:

CRITICAL RISK

(9.0)

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 course restoration can use paths from an imported legacy course backup without consistently restricting file operations to the extraction directory. A course teacher who imports a crafted backup may cause attacker-controlled files to be written elsewhere, potentially enabling code execution by the PHP process.

Affected context

The issue occurs in Chamilo LMS course restoration components that process paths supplied by a legacy course backup. It may affect deployments where a course teacher can import such a backup and the restoration process does not consistently verify that resolved paths remain within the intended extraction directory. Writes to PHP-executable or automatically loaded locations could increase the impact.

Exploit preconditions

  • Attack surface: Course backup import and restoration in Chamilo LMS
  • Required access: An account with permission to import a course backup, such as a course teacher
  • Trigger point: Processing files and paths from a crafted legacy backup
  • Why exploitation is possible: Path values are not consistently confined to the extraction directory, allowing file operations to target locations outside it

Why this happens

The underlying flaw is insufficient validation and confinement of paths derived from an imported archive. If parent-directory segments are accepted without resolving and checking the final destination against the intended extraction root, file operations can escape that directory. This maps primarily to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'). It also relates to CWE-73: External Control of File Name or Path; code execution may follow if attacker-controlled content is written to a location interpreted as executable code.

Potential impact

  • Attacker-controlled files could be written outside the intended course extraction directory.
  • PHP code could be executed with the privileges of the PHP process if a suitable executable or automatically loaded location is writable.
  • Course data, user data, or credentials could be exposed or altered.
  • The application host could be compromised, depending on its configuration and process privileges.

General mitigation guidance

Defensive patterns include resolving each destination to a canonical path and verifying that it remains beneath the intended extraction root before performing file operations. Reject traversal components and unexpected path forms, and use archive extraction mechanisms that enforce destination confinement by default. Treat imported backups as untrusted input, apply strict file and path validation, and avoid placing restored content in executable or automatically loaded locations. Restrict the PHP process and restoration workflow to the minimum filesystem permissions needed.

How teams detect issues like this

Review archive restoration code for paths built from imported filenames and for file operations that lack canonical-path containment checks. Static analysis can flag archive extraction, path joining, and file-write operations where externally controlled paths reach filesystem APIs without validation. Code review should examine handling of parent-directory segments, symlinks, and destination roots. Policies can require safe extraction libraries and tests that verify writes remain within approved directories.

Sources

SourceLink
github.comgithub.com/chamilo/chamilo-lms/commit/a2e404fb1d512908280011aa3a2211fc2fcb6ad8
github.comgithub.com/chamilo/chamilo-lms/commit/d23787c8c79a4ff09d46f73fcf54ccce1bbcba15
github.comgithub.com/chamilo/chamilo-lms/pull/8569
github.comgithub.com/chamilo/chamilo-lms/releases/tag/v1.11.40
github.comgithub.com/chamilo/chamilo-lms/releases/tag/v2.0.3
github.comgithub.com/chamilo/chamilo-lms/security/advisories/GHSA-97gp-5f3j-vwqr

Frequently asked

questions

Exploitation occurs through course backup import and depends on the restoration process accepting paths that can escape its intended extraction directory.

An attacker needs permission to import a course backup, such as the access available to a course teacher.

Resolve destination paths and enforce that every file operation stays within the designated extraction directory. Prefer extraction mechanisms that provide this protection by default.

Treat imported archives as untrusted, validate paths and file types, test extraction boundaries, and limit the filesystem privileges of the process performing restoration.

Find out what's already
exploitable in your codebase.