Miggo Logo

CVE-2022-3802:
IBAX go-ibax vulnerable to SQL injection

8.8

CVSS Score
3.1

Basic Information

EPSS Score
0.13655%
Published
11/1/2022
Updated
4/24/2024
KEV Status
No
Technology
TechnologyGo

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
github.com/IBAX-io/go-ibaxgo< 1.4.21.4.2

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from unsanitized use of the 'where' parameter in SQL query construction. In GetRowsInfo, the code uses fmt.Sprintf to directly insert user-controlled 'where' input into the SQL string (line 189 in original code). This allows attackers to inject arbitrary SQL commands. The getOpenRowsInfoHandler exposes this vulnerability via an API endpoint, as shown in the POC where pg_sleep() was injected. The commit fixed this by removing the entire database.go file containing these functions, indicating they were the attack surface.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

SQL Inj**tion vuln*r**ility in `/p**k***s/*pi/**t***s*.*o` o* *o-i**x vi* `w**r*` p*r*m*t*r *llows *tt**k*r to spoo* i**ntity, t*mp*r wit* *xistin* **t*, *llow t** *ompl*t* *is*losur* o* *ll **t* on t** syst*m, **stroy t** **t* or m*k* it ot**rwis* u

Reasoning

T** vuln*r**ility st*ms *rom uns*nitiz** us* o* t** 'w**r*' p*r*m*t*r in SQL qu*ry *onstru*tion. In **tRowsIn*o, t** *o** us*s *mt.Sprint* to *ir**tly ins*rt us*r-*ontroll** 'w**r*' input into t** SQL strin* (lin* *** in ori*in*l *o**). T*is *llows *