CVE-2016-5013: Moodle Does Not Escape Characters In Email Headers
5.4
CVSS Score
3.0
Basic Information
CVE ID
GHSA ID
EPSS Score
0.57648%
CWE
Published
5/13/2022
Updated
9/12/2023
KEV Status
No
Technology
PHP
Technical Details
CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
moodle/moodle | composer | >= 3.0, <= 3.0.4 | 3.0.5 |
moodle/moodle | composer | >= 2.9, <= 2.9.6 | 2.9.7 |
moodle/moodle | composer | >= 2.8, <= 2.8.12 | |
moodle/moodle | composer | >= 2.7, <= 2.7.14 | 2.7.15 |
moodle/moodle | composer | >= 3.1, < 3.1.1 | 3.1.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from improper escaping in email header construction. The commit diff shows critical changes to moodle_phpmailer.php's encodeHeader method, where special characters in 'phrase' context (like sender names) were not escaped with addcslashes. This allowed injection of CRLF sequences or additional email headers. The added test cases in text_test.php specifically verify escaping of quotes and backslashes in headers, confirming this was the attack vector. The CWE-74 classification and advisory description about header injection align perfectly with this code change.