Security Advisory

CVE-2018-20346: SQLite FTS3 Magellan Overflow

Last updated:
  • CVE-2018-20346

CVE-2018-20346, known as Magellan, is an integer overflow (CWE-190) in the FTS3 full-text search extension of SQLite that turns into a buffer overflow when FTS3 queries run over deliberately corrupted shadow tables. An attacker who can already run arbitrary SQL can use it to execute code. NVD scores it 8.1.

Vulnerability summary

CVSS base score

8.1

High severity

EPSS score (FIRST)

10.3%

Probability of exploitation in the wild in the next 30 days

CISA KEV catalog

No

Not listed

Published

Vulnerability ID: CVE-2018-20346 · Source: NVD

Affected components

ComponentCPEVersion range
SQLite (FTS3/FTS4 extension)cpe:2.3:a:sqlite:sqlite:*:*:*:*:*:*:*:*before 3.25.3 (NVD); SQLite lead developer Richard Hipp places the FTS3 fix in 3.26.0. Only builds with FTS3 or FTS4 enabled
Synology DSM and SRM—DSM 5.2, 6.1 and 6.2 fixed by DSM 6.2.2-24922; SRM 1.2 fixed by 1.2.1-7779; SkyNAS will not be fixed (Synology-SA-18:61)
OpenWrt packages feed: libsqlite3cpe:2.3:a:sqlite:sqlite:*:*:*:*:*:*:*:*3.54.1 on master, 3.53.1 on openwrt-25.12 (read 2026-11-18); FTS3 on by default

What does this mean for affected devices?

NVD's description: SQLite before 3.25.3, "when the FTS3 extension is enabled, encounters an integer overflow (and resultant buffer overflow) for FTS3 queries that occur after crafted changes to FTS3 shadow tables, allowing remote attackers to execute arbitrary code by leveraging the ability to run arbitrary SQL statements (such as in certain WebSQL use cases), aka Magellan." NVD's Primary score is CVSS v3.0 8.1 (CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H) and CVSS v2 6.8, with CWE-190. The CPE range is SQLite before 3.25.3, plus Chrome before 71.0.3578.80, and the record was published on 2018-12-21 (NVD).

What does an attacker need?

Two things: a build with FTS3 compiled in, and a way to run their own SQL. SQLite lead developer Richard Hipp wrote on the sqlite-users list on 2018-12-18 that the bug is "in FTS3 (not in the SQLite core)" and is "only a problem for application that enable FTS3 (using the SQLITE_ENABLE_FTS3 or SQLITE_ENABLE_FTS4 compile-time options) and which allow potential attackers to run arbitrary SQL." He named Chrome, through WebSQL, as the one such application he knew of, and said the bug "makes a preexisting SQL Injection bug worse, but does not introduce any new bugs." On a device, the same conditions mean a web or API handler that builds SQL from request data against a database that has FTS3 tables.

Which version fixes it?

NVD and the Debian tracker put the line at 3.25.3; Hipp's post says "The bug in FTS3 was fixed in version 3.26.0" and describes the new SQLITE_DBCONFIG_DEFENSIVE option as defence in depth rather than the fix. Treat 3.26.0 or later as fixed. The Debian security tracker lists fixed sqlite3 packages 3.8.7.1-1+deb8u3 for jessie and 3.16.2-5+deb9u2 for stretch, so a distribution build with an older upstream number can still be patched.

Which devices shipped it?

Synology-SA-18:61 covers Magellan across its NAS and router software at moderate severity, with its own CVSS 3.0 score of 6.3 (AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L), which assumes an authenticated user. DiskStation Manager 5.2, 6.1 and 6.2 are fixed by DSM 6.2.2-24922, Synology Router Manager 1.2 by SRM 1.2.1-7779 and Surveillance Station by 8.2.9-7296; SkyNAS "will not fix". OpenWrt's packages feed builds libsqlite3 3.54.1 on master with FTS3 on by default, while Buildroot leaves FTS3 as an opt-in option. Our SQLite firmware guide shows how to read the SQLite version and compile options from an image, and the memory corruption fix guide covers the overflow class. Related SQLite pages: CVE-2022-35737 (printf large strings), CVE-2019-19646 and CVE-2025-6965.

How do you fix or mitigate it?

Ship SQLite 3.26.0 or later, or a distribution package that carries the fix. Where the library cannot move, build without FTS3 if no full-text search is used, and set SQLITE_DBCONFIG_DEFENSIVE on connections that may see untrusted SQL; SQLite's Defense Against the Dark Arts page says it "prevents ordinary SQL statements from deliberately corrupting the database file". Above all, close the SQL injection path in the device's own code.

CVE-2018-20346 is not in the CISA KEV catalog as of 2026-11-18 (catalog version 2026.11.17). FIRST EPSS gives it 0.10312, the 95.8th percentile, in the 2026-11-17 dataset (CISA KEV, FIRST EPSS).

How to fix this class of issueThis advisory's weakness class is Memory corruption. Our practical guide covers how to detect, fix, verify and disclose it: How to fix memory corruption in embedded firmware.

Evidence

  • NVD: SQLite before 3.25.3 with FTS3, integer overflow and resultant buffer overflow after crafted changes to FTS3 shadow tables, code execution by running arbitrary SQL, aka Magellan; Primary CVSS v3.0 8.1 AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H, CVSS v2 6.8; CWE-190; CPE sqlite < 3.25.3, chrome < 71.0.3578.80; published 2018-12-21. — NVD
  • Richard Hipp, 2018-12-18: bug in FTS3, not the core; only applications that enable FTS3/FTS4 and let attackers run arbitrary SQL; makes an existing SQL injection worse; fixed in 3.26.0; SQLITE_DBCONFIG_DEFENSIVE added as defence in depth. — sqlite-users mailing list
  • Synology-SA-18:61 Magellan: moderate, CVSS3 6.3 AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L; DSM 6.2/6.1/5.2 upgrade to 6.2.2-24922; SRM 1.2 upgrade to 1.2.1-7779; Surveillance Station 8.2.9-7296; SkyNAS will not fix. — Synology
  • Debian: sqlite3 fixed 3.8.7.1-1+deb8u3 (jessie, DLA-1613-1), 3.16.2-5+deb9u2 (stretch, DLA-2340-1), 3.25.3-1 (unstable); sqlite (v2) not affected. — Debian security tracker
  • OpenWrt packages libs/sqlite3: PKG_VERSION 3.54.1 on master, 3.53.1 on openwrt-25.12; SQLITE3_FTS3 default y (read 2026-11-18). — OpenWrt packages
  • Buildroot package/sqlite Config.in: BR2_PACKAGE_SQLITE_ENABLE_FTS3 is a bool option (off unless selected). — Buildroot
  • SQLite Defense Against the Dark Arts: SQLITE_DBCONFIG_DEFENSIVE prevents ordinary SQL statements from deliberately corrupting the database file. — SQLite
  • CVE-2018-20346 is not in the CISA KEV catalog, version 2026.11.17 (1,782 entries), checked 2026-11-18. — CISA KEV
  • EPSS 0.10312, percentile 0.95785, dataset 2026-11-17. — FIRST EPSS

Related advisories

Sources

  1. NVD
  2. Richard Hipp on Magellan (sqlite-users, 2018-12-18)
  3. Synology-SA-18:61 Magellan
  4. Debian security tracker
  5. OpenWrt packages: sqlite3 build options
  6. Buildroot: sqlite package options
  7. SQLite: Defense Against the Dark Arts
  8. CISA KEV
  9. FIRST EPSS

Frequently asked questions

Which SQLite versions are affected by CVE-2018-20346?

NVD lists SQLite before 3.25.3, but only builds with the FTS3 or FTS4 extension compiled in. SQLite lead developer Richard Hipp places the FTS3 fix in 3.26.0, so treat 3.26.0 or later, or a distribution package that carries the fix, as fixed (per NVD and the sqlite-users list).

Can CVE-2018-20346 be exploited without SQL injection?

No. The overflow needs crafted changes to FTS3 shadow tables followed by FTS3 queries, so the attacker must already be able to run arbitrary SQL. Hipp described it as making an existing SQL injection worse rather than adding a new entry point (per the sqlite-users list).

Which devices were patched for Magellan?

Synology-SA-18:61 lists DiskStation Manager 5.2 to 6.2, fixed by DSM 6.2.2-24922, Synology Router Manager 1.2, fixed by SRM 1.2.1-7779, and Surveillance Station 8.2.9-7296; SkyNAS will not be fixed (per Synology).

Is CVE-2018-20346 in the CISA KEV catalog?

No, not as of 2026-11-18 (catalog version 2026.11.17). FIRST EPSS gives it 0.10312, the 95.8th percentile, in the 2026-11-17 dataset (per CISA KEV and FIRST EPSS).