Miggo Logo

CVE-2023-30944:
Moodle SQL Injection vulnerability

7.3

CVSS Score

Basic Information

EPSS Score
-
Published
5/2/2023
Updated
4/19/2024
KEV Status
No
Technology
TechnologyPHP

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
Package NameEcosystemVulnerable VersionsFirst Patched Version
moodle/moodlecomposer< 4.2.0-rc24.2.0-rc2

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from the pre-patch code in get_subwiki_pages() where user-supplied 'sortby' and 'sortdirection' parameters were concatenated into an SQL ORDER BY clause without proper whitelist validation. The patch introduced get_safe_orderby() to validate these parameters against a predefined list of allowed columns, confirming the original implementation lacked proper input sanitization for SQL query construction.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

T** vuln*r**ility w*s *oun* Moo*l* w*i** *xists *u* to insu**i*i*nt s*nitiz*tion o* us*r-suppli** **t* in *xt*rn*l Wiki m*t*o* *or listin* p***s. * r*mot* *tt**k*r **n s*n* * sp**i*lly *r**t** r*qu*st to t** *****t** *ppli**tion *n* *x**ut* limit** S

Reasoning

T** vuln*r**ility st*ms *rom t** pr*-p*t** *o** in **t_su*wiki_p***s() w**r* us*r-suppli** 'sort*y' *n* 'sort*ir**tion' p*r*m*t*rs w*r* *on**t*n*t** into *n SQL OR**R *Y *l*us* wit*out prop*r w*it*list v*li**tion. T** p*t** intro*u*** **t_s***_or**r*