# CVE-2020-15147: Remote Code Execution in Red Discord Bot

> Attackers can execute arbitrary code via crafted Discord messages in the Streams module, potentially accessing sensitive data or causing damage.

- **Severity:** High 8.5 (`CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 21 Aug 2020
- **Updated:** 4 Aug 2024
- **Also known as:** GHSA-7257-96vg-qf6x, PYSEC-2020-266

## What is CVE-2020-15147?

CVE-2020-15147 is a high-severity code injection vulnerability in Cog-Creators Red-DiscordBot, published on 21 Aug 2020. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

Red Discord Bot before versions 3.3.12 and 3.4 has a Remote Code Execution vulnerability in the Streams module. This exploit allows Discord users with specifically crafted "going live" messages to inject code into the Streams module's going live message. By abusing this exploit, it's possible to perform destructive actions and/or access sensitive information. As a workaround, unloading the Trivia module with `unload streams` can render this exploit not accessible. It is highly recommended updating to 3.3.12 or 3.4 to completely patch this issue.

Weakness: CWE-74 (Improper Neutralization of Special Elements in Output Used by a Downstream Component), CWE-94 (Improper Control of Generation of Code)

## Which versions are affected by CVE-2020-15147?

3 open source packages ship an affected version, including red-discordbot and Red-DiscordBot. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `red-discordbot` | PyPI | All versions | 3.3.12 |
| `red-discordbot` | PyPI | All versions | 3.3.12 |
| `Red-DiscordBot` | PyPI | All versions | 3.3.12 |

Products: Cogboard Red Discord Bot.

## How do I fix CVE-2020-15147?

Upgrade red-discordbot to 3.3.12 or later.

## Is CVE-2020-15147 being exploited?

There is no known exploitation of CVE-2020-15147 in the wild and no public exploit code.

## Other vulnerabilities in Cog-Creators Red-DiscordBot

- [CVE-2020-15140](https://insights.sbomify.com/CVE-2020-15140/): Remote Code Execution in Red Discord Bot (high 8.2)
- [CVE-2020-15278](https://insights.sbomify.com/CVE-2020-15278/): Unauthorized privilege escalation in Mod module (high 7.7)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2020-15147 and fix it if it is affected.

What it is: CVE-2020-15147 is a high-severity code injection vulnerability in Cog-Creators Red-DiscordBot, published on 21 Aug 2020. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2020-15147 in the wild and no public exploit code.

Affected packages and fixed versions:
- red-discordbot (PyPI): affected all versions; fixed in 3.3.12
- red-discordbot (PyPI): affected all versions; fixed in 3.3.12
- Red-DiscordBot (PyPI): affected all versions; fixed in 3.3.12

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2020-15147/ (Markdown: https://insights.sbomify.com/CVE-2020-15147/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2020-15147
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2020-15147
- OSV: https://osv.dev/vulnerability/CVE-2020-15147

---
From sbomify Insights: https://insights.sbomify.com/CVE-2020-15147/
Summaries are generated and may contain mistakes; the official description above is the record.
