SQLite Vulnerability: Inadequate Protection Mechanism in sqlite3 Package

sqlite3 Updated 02 Oct 2025

Summary

12/12/2022
N/A
Yes i
High
7.3

UBUNTU-CVE-2022-46908: SQLite through 3.40.0, when relying on --safe for execution of an untrusted CLI script, does not properly implement the azProhibitedFunctions protection mechanism, and instead allows UDF functions such as WRITEFILE. Affects sqlite3 versions < 3.37.2-2ubuntu0.3. Fixed in 3.37.2-2ubuntu0.3. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

SQLite is a widely-used, lightweight database engine that is embedded in applications. It provides a self-contained, serverless, zero-configuration, and transactional SQL database engine. The sqlite3 package is essential for applications that require database functionalities. However, a recent vulnerability has been identified that compromises the security of untrusted CLI scripts executed with SQLite.

Vulnerability Detail

The vulnerability, identified as CVE-2022-46908, affects SQLite versions up to 3.40.0. When using the --safe option for executing untrusted CLI scripts, the azProhibitedFunctions protection mechanism is not properly implemented. This oversight allows User Defined Functions (UDFs) such as WRITEFILE to be executed, potentially leading to unauthorized file access and manipulation. The CVSS score for this vulnerability is 7.3, indicating a high severity level that could result in significant data breaches or system compromises.

How To Fix

Minimum fixed version

3.37.2-2ubuntu0.3

This is the first release that contains the fix.

sudo apt-get install --only-upgrade sqlite3

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, avoid executing untrusted CLI scripts with the --safe option until the package is updated. Additionally, review and restrict the use of UDFs in your SQLite scripts to mitigate potential risks.

Conclusion

The CVE-2022-46908 vulnerability in SQLite poses significant risks when executing untrusted CLI scripts. It is crucial to update the sqlite3 package to the latest patched version to ensure the security of your applications. Utilizing tools like Vulert can further enhance your ability to monitor and address vulnerabilities effectively.

See every vulnerability recorded for sqlite3 →

Share this vulnerability

FAQ

CVE-2022-46908 is a vulnerability in SQLite that allows unauthorized execution of User Defined Functions when using the --safe option for untrusted CLI scripts.

The risks include unauthorized file access and manipulation, which could lead to data breaches and system compromises.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.

It is recommended to update the sqlite3 package to the patched version 3.37.2-2ubuntu0.3 or later to mitigate the vulnerability.

Vulert monitors and alerts in real-time for open-source vulnerabilities using just a manifest file like package-lock.json, helping developers maintain secure applications.

Related vulnerabilities

Recent vulnerabilities recorded for sqlite3.

How To Fix

Minimum fixed version

3.37.2-2ubuntu0.3

This is the first release that contains the fix.

sudo apt-get install --only-upgrade sqlite3

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback