Miggo Logo

CVE-2006-4936: Moodle does not properly validate module instance id

10

CVSS Score

Basic Information

EPSS Score
0.58439%
Published
5/1/2022
Updated
2/12/2024
KEV Status
No
Technology
TechnologyPHP

Technical Details

CVSS Vector
AV:N/AC:L/Au:N/C:C/I:C/A:C
Package NameEcosystemVulnerable VersionsFirst Patched Version
moodle/moodlecomposer< 1.6.21.6.2

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from using get_record('course_modules', 'id', $id) without verifying the module context. The patch introduced get_coursemodule_from_id(), which adds module-type validation (via JOIN on modules table). The widespread replacement of get_record with this new function across 30+ module files indicates the original pattern was unsafe. CWE-20 is directly addressed by adding proper input validation through module-type checks.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

Moo*l* ***or* *.*.* *o*s not prop*rly v*li**t* t** mo*ul* inst*n** i* w**n *r**tin* * *ours* mo*ul* o*j**t, w*i** **s unsp**i*i** imp**t *n* r*mot* *tt**k v**tors.

Reasoning

T** vuln*r**ility st*ms *rom usin* **t_r**or*('*ours*_mo*ul*s', 'i*', $i*) wit*out v*ri*yin* t** mo*ul* *ont*xt. T** p*t** intro*u*** **t_*ours*mo*ul*_*rom_i*(), w*i** ***s mo*ul*-typ* v*li**tion (vi* JOIN on mo*ul*s t**l*). T** wi**spr*** r*pl***m*n