Miggo Logo

CVE-2024-36760:
Rhai stack overflow vulenrability

7.5

CVSS Score
3.1

Basic Information

EPSS Score
0.44011%
Published
6/13/2024
Updated
8/4/2024
KEV Status
No
Technology
TechnologyRust

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
rhairust<= 1.18.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from missing recursion depth management in function call handling. The commit diff shows 'defer!' blocks added to increment a 'global.level' counter in 4 locations within src/func/call.rs, indicating these were points where recursive calls weren't properly tracked. The stack trace shows repeated calls between eval_stmt_block and call_script_fn, while the test case demonstrates recursion through closure methods. Both functions are part of the call chain that failed to enforce recursion limits, making them root causes.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

* st**k ov*r*low vuln*r**ility w*s *oun* in v*rsion *.**.* o* r**i. T** *l*w position is: (/ SR*/r**i/SR*/*v*l/STMT. Rs in r**i: : *v*l: : STMT: : _ $LT $impl $u** $r**i.. *n*in*.. *n*in*$*T$::*v*l_stmt::*****************). *u* to t** st**k ov*r*low

Reasoning

T** vuln*r**ility st*ms *rom missin* r**ursion **pt* m*n***m*nt in *un*tion **ll **n*lin*. T** *ommit *i** s*ows '****r!' *lo*ks ***** to in*r*m*nt * '*lo**l.l*v*l' *ount*r in * lo**tions wit*in sr*/*un*/**ll.rs, in*i**tin* t**s* w*r* points w**r* r*