Cloudanix VulnDB

CVE-2024-45691

None

Moodle Lesson activity password bypass through PHP loose comparison

CVSS

—

EPSS

0.4%

Published

Nov 20, 2024

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

A password lock on certain course activities in an online learning system could be bypassed if the lock used one of a small set of specially formatted passwords.

Exploitation
Remote Authenticated
Attacker needs
Low Privilege
Complexity
Moderate
Impact
Privilege Gain
Component
Application
Class
Authorization Bypass
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

Loose string comparison in lesson activity password validation allows bypass when the configured password matches a magic hash value, causing the check to evaluate true for crafted inputs due to PHP type juggling.

Why it matters to the business

Attackers can access restricted educational content without authorization, undermining access controls on learning platforms and potentially exposing lesson materials or enabling unauthorized progression.

How an attack unfolds

An attacker targets a password-protected lesson activity whose stored password is a magic hash string; they submit a specially crafted input that loosely equals the stored value under PHP loose comparison, granting access without knowing the actual password.

How to fix it

Upgrade moodle/moodle to the fixed commit d4f5e92ee156002b95db1ab6f76e25870563e2f6 or apply the corresponding patch to enforce strict password comparison; ignore unrelated libarchive packages listed in affected products.

How to confirm the fix worked

Review source code for replacement of loose (==) comparisons with strict (===) checks in password validation functions; test by attempting access with known magic hash bypass strings after upgrade to confirm denial.

Typical attack path

  1. Locate a lesson activity configured with password access restriction
  2. Determine or test for a stored password matching a known magic hash format
  3. Submit a crafted string input that triggers loose equality in the comparison logic
  4. Gain unauthorized entry to the lesson content or activities

How to detect it

Search Moodle access logs for repeated failed or successful lesson attempts originating from the same session with unusual password values; correlate with lesson activity configuration exports to identify any magic-hash-formatted passwords still in use.

What your security team should do

  • Prioritize upgrade of all Moodle instances to the patched commit within standard change windows given stable low EPSS and no KEV listing
  • Audit existing lesson activities for any passwords that match documented magic hash patterns and rotate them
  • Implement code review requirements for all future authentication logic changes to prevent similar comparison flaws

The record

A flaw was found in Moodle. When restricting access to a lesson activity with a password, certain passwords could be bypassed or less secure due to a loose comparison in the password-checking logic. This issue only affected passwords set to "magic hash" values.

Affected packages

Ecosystem Package Introduced Fixed
Packagist moodle/moodle 0 4.1.13
Packagist moodle/moodle 4.2.0-beta 4.2.10
Packagist moodle/moodle 4.3.0-beta 4.3.7
Packagist moodle/moodle 4.4.0-beta 4.4.3
Bitnami moodle 0 4.1.13
Ubuntu:16.04:LTS moodle 0 No fix
Ubuntu:18.04:LTS moodle 0 No fix
Ubuntu:Pro:16.04:LTS moodle 0 No fix
Ubuntu:Pro:18.04:LTS moodle 0 No fix
packagist moodle/moodle 4.2.0-beta 4.2.10
packagist moodle/moodle 4.3.0-beta 4.3.7
packagist moodle/moodle 4.4.0-beta 4.4.3

Related vulnerabilities