CVE-2023-28102 Command injection in discordrb

High 8.4 Published Updated

Attackers can execute arbitrary shell commands if user input reaches the vulnerable encoder method in the discordrb Ruby library.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2023-28102?

CVE-2023-28102 is a high-severity command injection vulnerability in shardlab discordrb, published on 27 Mar 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

discordrb is an implementation of the Discord API using Ruby. In discordrb before commit `91e13043ffa` the `encoder.rb` file unsafely constructs a shell string using the file parameter, which can potentially leave clients of discordrb vulnerable to command injection. The library is not directly exploitable: the exploit requires that some client of the library calls the vulnerable method with user input. However, if unsafe input reaches the library method, then an attacker can execute arbitrary shell commands on the host machine. Full impact will depend on the permissions of the process running the `discordrb` library and will likely not be total system access. This issue has been addressed in code, but a new release of the `discordrb` gem has not been uploaded to rubygems. This issue is also tracked as `GHSL-2022-094`.

Weakness: CWE-78

Which versions are affected by CVE-2023-28102?

2 open source packages ship an affected version, including discordrb. It affects 1 product.

PackageAffectedFixed in
discordrb RubyGemsAll versions3.4.3
discordrb RubyGemsAll versions3.4.3

Products include Discordrb Project Discordrb.

How do I fix CVE-2023-28102?

Upgrade discordrb to 3.4.3 or later.

Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.

Is CVE-2023-28102 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-28102 exists.

Sources

Also known as GHSA-8832-4mm5-x2r6.

Is CVE-2023-28102 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free