Miggo Logo

CVE-2023-28102: discordrb OS Command Injection vulnerability

9.7

CVSS Score
3.1

Basic Information

EPSS Score
0.73369%
Published
3/14/2024
Updated
3/14/2024
KEV Status
No
Technology
TechnologyRuby

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
discordrbrubygems< 3.4.33.4.3

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from constructing shell commands via unsafe string interpolation in encode_file and encode_io methods. The commit diff shows both methods were modified to use an array-based invocation (safe) instead of string interpolation (unsafe). The original implementation in encoder.rb line 80/90 directly interpolated user-controlled parameters into command strings passed to IO.popen, making them vulnerable to command injection. The CVE description and patch commit confirm these were the vulnerable entry points.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

*is*or*r* is *n impl*m*nt*tion o* t** *is*or* *PI usin* Ru*y. In *is*or*r* ***or* *ommit `***********` t** `*n*o**r.r*` *il* uns***ly *onstru*ts * s**ll strin* usin* t** *il* p*r*m*t*r, w*i** **n pot*nti*lly l**v* *li*nts o* *is*or*r* vuln*r**l* to *

Reasoning

T** vuln*r**ility st*ms *rom *onstru*tin* s**ll *omm*n*s vi* uns*** strin* int*rpol*tion in *n*o**_*il* *n* *n*o**_io m*t*o*s. T** *ommit *i** s*ows *ot* m*t*o*s w*r* mo*i*i** to us* *n *rr*y-**s** invo**tion (s***) inst*** o* strin* int*rpol*tion (u