CVE-2022-39183
Medium · 6.1CVSS
6.1
EPSS
0.4%
Published
Jan 12, 2023
CISA due date
—
Cloudanix analysis
A problem in the way Moodle handles logins with certain single-sign-on setups could let attackers trick users into visiting fake websites that look legitimate.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Data Exposure
- Component
- Application
- Class
- Open Redirect
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
The SAML authentication plugin fails to validate or restrict redirect targets, allowing an attacker-supplied URL to be accepted during the authentication response flow and causing the browser to be sent to an arbitrary external site.
Why it matters to the business
Users can be silently redirected to attacker-controlled pages that mimic login or other trusted interfaces, increasing the chance of credential theft or malware distribution with minimal user interaction required.
How an attack unfolds
An attacker crafts a link containing a malicious redirect destination, delivers it via phishing or another channel, and the victim who follows the link through the SAML login flow is sent to the attacker site after the authentication step completes.
How to fix it
Upgrade the SAML authentication plugin to the latest patched release that enforces an allow-list of permitted redirect domains; if no update is available, temporarily disable the plugin or add server-side validation of all redirect parameters before issuing the redirect.
How to confirm the fix worked
Review the installed SAML plugin version against the vendor advisory, attempt to trigger an open redirect with a test URL containing an external domain, and confirm that only approved internal or same-origin redirects are honored after the fix.
Typical attack path
- Identify a Moodle instance using the vulnerable SAML auth plugin
- Craft a URL that supplies an attacker-controlled redirect target in the SAML response or RelayState parameter
- Deliver the link to targeted users through email, chat, or other channels
- Victim follows the link and completes or initiates SAML authentication
- Browser is redirected to the attacker site, enabling phishing or drive-by attacks
How to detect it
Inspect web server and application logs for SAML authentication requests or responses that contain redirect or RelayState parameters pointing to external domains not belonging to the organization; correlate with user reports of unexpected redirects after login attempts.
What your security team should do
- Prioritize updating the SAML authentication plugin as soon as a fixed version is released
- Implement a temporary WAF or proxy rule that blocks or logs SAML responses containing external redirect targets
- Educate users to verify URLs before entering credentials on any redirected page
- Monitor authentication logs for redirect parameters pointing outside the organization's domains
The record
Moodle Plugin - SAML Auth may allow Open Redirect through unspecified vectors.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| 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 |
Related vulnerabilities
- CVE-2024-45691 Moodle Lesson activity password bypass through PHP loose comparison Also affects moodle
- CVE-2024-45689 Moodle allows users to retrieve information they did not have permission to access Also affects moodle
- CVE-2024-45690 Moodle IDOR when deleting OAuth2 linked accounts Also affects moodle
- CVE-2024-48899 Moodle IDOR when accessing list of course badges Also affects moodle
- CVE-2024-48897 moodle: IDOR in edit/delete RSS feed Also affects moodle
- CVE-2024-48898 moodle: Some users can delete audiences of other reports Also affects moodle
- CVE-2024-48896 Moodle leaks user names Also affects moodle
- CVE-2024-48901 moodle: IDOR when fetching report schedules Also affects moodle