Moodle - Insecure Enforcement of forceloginforprofiles Setting

moodle/moodle Updated 02 Oct 2025

Summary

13/05/2022
Yes i
Moderate
Not published

CVE-2013-1830: Moodle does not enforce the forceloginforprofiles setting. Affects moodle/moodle across 4 version ranges.

< 2.1.10 >= 2.2.0, < 2.2.8 >= 2.3.0, < 2.3.5 >= 2.4.0, < 2.4.2

Fixed in 4 releases; the minimum fixed version depends on the release line you run. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Moodle is an open-source learning management system (LMS) used by educational institutions to create and manage online courses. It provides a platform for educators to deliver content, interact with students, and assess their progress. Moodle is widely adopted and offers a range of features such as course management, user management, grading, and communication tools.

Vulnerability Detail

The vulnerability identified as GHSA-8r7x-qq55-74v2 affects Moodle versions 2.1.10, 2.2.x before 2.2.8, 2.3.x before 2.3.5, and 2.4.x before 2.4.2. The issue resides in the 'user/view.php' file, where the 'forceloginforprofiles' setting is not enforced. This allows remote attackers to access sensitive course-profile information by leveraging the guest role. An attacker can exploit this vulnerability to obtain unauthorized access to course-related data, potentially compromising the privacy and security of users. The vulnerability has been assigned a moderate severity rating.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 2.1.10 2.1.10
    composer require moodle/moodle:2.1.10
  • >= 2.2.0, < 2.2.8 2.2.8
    composer require moodle/moodle:2.2.8
  • >= 2.3.0, < 2.3.5 2.3.5
    composer require moodle/moodle:2.3.5
  • >= 2.4.0, < 2.4.2 2.4.2
    composer require moodle/moodle:2.4.2

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

If upgrading to the latest version is not immediately feasible, a temporary workaround can be implemented by manually enforcing the 'forceloginforprofiles' setting in the 'user/view.php' file. This can be achieved by modifying the code to ensure that the setting is properly checked and enforced before allowing access to course-profile information. Here is an example of the modified code:

// Check if forceloginforprofiles is enabled
if ($CFG->forceloginforprofiles) {
    // Enforce login
    require_login();
}

// Rest of the code
// ...

Please note that this workaround is not a permanent solution and should be replaced with the official fix as soon as possible.

Conclusion

The identified vulnerability in Moodle allows unauthorized access to course-profile information, potentially compromising the privacy and security of users. It is crucial to upgrade to the latest version of Moodle or apply the provided workaround to mitigate the risk. For further support and assistance with vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for moodle/moodle →

Share this vulnerability

FAQ

Moodle is an open-source learning management system (LMS) used by educational institutions to create and manage online courses. It provides a platform for educators to deliver content, interact with students, and assess their progress.

The vulnerability affects Moodle versions 2.1.10, 2.2.x before 2.2.8, 2.3.x before 2.3.5, and 2.4.x before 2.4.2.

The vulnerability allows remote attackers to access sensitive course-profile information by leveraging the guest role. This can lead to unauthorized access to course-related data and compromise the privacy and security of users.

To fix this vulnerability, it is recommended to upgrade to the latest version of Moodle (2.2.8, 2.3.5, or 2.4.2). This will enforce the 'forceloginforprofiles' setting and prevent unauthorized access to course-profile information.

Yes, if immediate upgrading is not possible, a temporary workaround can be implemented by manually enforcing the 'forceloginforprofiles' setting in the 'user/view.php' file. However, this should be replaced with the official fix as soon as possible.

Related vulnerabilities

Recent vulnerabilities recorded for moodle/moodle.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 2.1.10 2.1.10
    composer require moodle/moodle:2.1.10
  • >= 2.2.0, < 2.2.8 2.2.8
    composer require moodle/moodle:2.2.8
  • >= 2.3.0, < 2.3.5 2.3.5
    composer require moodle/moodle:2.3.5
  • >= 2.4.0, < 2.4.2 2.4.2
    composer require moodle/moodle:2.4.2

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback