# CVE-2021-20227: Use after free in sqlite

> A use-after-free flaw in SQLite allows local attackers to cause denial of service or execute arbitrary code via crafted SQL queries.

- **Severity:** Medium 5.5 (`CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 23 Mar 2021
- **Updated:** 14 Oct 2026
- **Also known as:** ALPINE-CVE-2021-20227, BIT-sqlite-2021-20227, CLEANSTART-2026-JU58706, DEBIAN-CVE-2021-20227, GHSA-w586-cvch-p9ch, OESA-2021-1252

## What is CVE-2021-20227?

CVE-2021-20227 is a medium-severity use after free vulnerability in Oracle Jd Edwards Enterpriseone Tools, published on 23 Mar 2021. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

A flaw was found in SQLite's SELECT query functionality (src/select.c). This flaw allows an attacker who is capable of running SQL queries locally on the SQLite database to cause a denial of service or possible code execution by triggering a use-after-free. The highest threat from this vulnerability is to system availability.

Weakness: CWE-416 (Use After Free)

## Which versions are affected by CVE-2021-20227?

1 open source package ship an affected version, including sqlite. It affects 7 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `sqlite` | Bitnami | From 3.33.0 | 3.34.1 |

Products: Oracle Communications Network Charging and Control, Oracle Enterprise Manager for Oracle Database, Oracle Jd Edwards Enterpriseone Tools, Oracle Mysql Workbench, Oracle Outside in Technology, Oracle Zfs Storage Appliance Kit, Sqlite Sqlite.

## How do I fix CVE-2021-20227?

Upgrade sqlite to 3.34.1 or later.

## Is CVE-2021-20227 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2021-20227 and fix it if it is affected.

What it is: CVE-2021-20227 is a medium-severity use after free vulnerability in Oracle Jd Edwards Enterpriseone Tools, published on 23 Mar 2021. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2021-20227 in the wild and no public exploit code.

Affected packages and fixed versions:
- sqlite (Bitnami): affected from 3.33.0; fixed in 3.34.1

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-2021-20227/ (Markdown: https://insights.sbomify.com/CVE-2021-20227/index.md)
```

## Sources

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

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