Security Advisory

CVE-2023-7104: SQLite Session Heap Overflow

Last updated:
  • CVE-2023-7104

CVE-2023-7104 is a heap buffer overflow (CWE-119) in sessionReadRecord() in the SQLite session extension: a subtly corrupted changeset makes it read past a heap buffer. Only builds compiled with SQLITE_ENABLE_SESSION that apply untrusted changesets are exposed. NVD scores it 7.3; VulDB, the CNA, scores 5.5.

Vulnerability summary

CVSS base score

7.3

High severity

EPSS score (FIRST)

1.5%

Probability of exploitation in the wild in the next 30 days

CISA KEV catalog

No

Not listed

Published

Vulnerability ID: CVE-2023-7104 · Source: NVD

Affected components

ComponentCPEVersion range
SQLite session extensioncpe:2.3:a:sqlite:sqlite:*:*:*:*:*:*:*:*up to 3.43.0 (NVD); fixed in 3.43.1 (SQLite); only builds with SQLITE_ENABLE_SESSION
Siemens RUGGEDCOM CROSSBOW Station Access Controller—before V5.6; fixed in V5.6 (Siemens SSA-000297)
Siemens SIMATIC S7-1500 TM MFP (GNU/Linux subsystem)—before V1.1; fixed in V1.1 (Siemens SSA-794697)
Siemens SINEC INS and SIDIS Prime—SINEC INS before V1.0 SP2 Update 3 (SSA-915275); SIDIS Prime before V4.0.700 (SSA-277137)

What does this mean for affected devices?

NVD's record says the issue "affects the function sessionReadRecord of the file ext/session/sqlite3session.c" in SQLite up to 3.43.0 and "leads to heap-based buffer overflow." NVD's Primary score is CVSS v3.1 7.3 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L) with CWE-119; VulDB, the CNA, scores it 5.5 (AV:A/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L) with CWE-122. The record was published on 2023-12-29 (NVD).

Where is the bug?

A researcher reported it on the SQLite forum on 2023-09-07: running the sessionfuzz test harness under AddressSanitizer showed a heap-buffer overflow in sessionReadRecord(), because the code did not validate the read offset before decoding an integer or float value from the changeset. Dan Kennedy of the SQLite team replied the same day that it "Should now be fixed." The SQLite Vulnerabilities page lists the fix in 3.43.1 (2023-09-11) and says the bug is "only reachable by applications that recompile SQLite using the -DSQLITE_ENABLE_SESSION compile-time option and then use the Session C-language APIs to process a changeset that has been subtly corrupted by an adversary. So this bug probably does not apply to you."

Which devices list it?

Siemens names it in four advisories, each at 5.5, the VulDB vector: SSA-000297 for the RUGGEDCOM CROSSBOW Station Access Controller, fixed in V5.6; SSA-794697 for the GNU/Linux subsystem of the SIMATIC S7-1500 TM MFP, fixed in V1.1, with the extra advice to "only build and run applications from trusted sources"; SSA-915275 for SINEC INS, fixed in V1.0 SP2 Update 3; and SSA-277137 for SIDIS Prime, fixed in V4.0.700. CROSSBOW SAC also carries CVE-2025-6965. In OpenWrt's libsqlite3 the session extension is off by default, so stock builds lack the code. Our SQLite firmware guide shows how to check compile options in a binary, and the memory corruption fix guide covers bounds checks on parsed input. Related: CVE-2022-35737 and CVE-2018-20346.

How do you fix or mitigate it?

Ship SQLite 3.43.1 or later, or the Siemens updates above. If the session extension is not used, build without SQLITE_ENABLE_SESSION; if it is, apply changesets only from authenticated peers. The Debian security tracker lists fixed sqlite3 packages 3.34.1-3+deb11u1 for bullseye and 3.40.1-2+deb12u1 for bookworm.

CVE-2023-7104 is not in the CISA KEV catalog as of 2026-11-18 (catalog version 2026.11.17). FIRST EPSS gives it 0.01464, the 74.1st 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: sessionReadRecord in ext/session/sqlite3session.c, SQLite up to 3.43.0, heap-based buffer overflow; Primary CVSS v3.1 7.3 AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L, CWE-119; VulDB (CNA) 5.5 AV:A/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L, CWE-122; published 2023-12-29. — NVD
  • SQLite forum 2023-09-07: heap-buffer-overflow in sessionReadRecord found with sessionfuzz and ASan; Dan Kennedy: should now be fixed. — SQLite forum
  • SQLite Vulnerabilities page: fixed in 3.43.1 (2023-09-11); session extension only, needs -DSQLITE_ENABLE_SESSION and a corrupted changeset; probably does not apply. — SQLite
  • Siemens SSA-000297 (2024-11-12): RUGGEDCOM CROSSBOW SAC, update to V5.6; CVSS 5.5. — Siemens ProductCERT
  • Siemens SSA-794697: SIMATIC S7-1500 TM MFP GNU/Linux subsystem < V1.1, update to V1.1, mitigation: only build and run applications from trusted sources; CVSS 5.5. — Siemens ProductCERT
  • Siemens SSA-915275 (2024-11-12): SINEC INS, update to V1.0 SP2 Update 3; CVSS 5.5. — Siemens ProductCERT
  • Siemens SSA-277137 (2025-04-08): SIDIS Prime, update to V4.0.700; CVSS 5.5. — Siemens ProductCERT
  • OpenWrt packages libs/sqlite3 Config-lib.in: SQLITE3_SESSION default n. — OpenWrt packages
  • Debian: sqlite3 fixed 3.34.1-3+deb11u1 (bullseye, DLA-3907-1), 3.40.1-2+deb12u1 (bookworm), 3.43.1-1 (unstable). — Debian security tracker
  • CVE-2023-7104 is not in the CISA KEV catalog, version 2026.11.17 (1,782 entries), checked 2026-11-18. — CISA KEV
  • EPSS 0.01464, percentile 0.74090, dataset 2026-11-17. — FIRST EPSS

Related advisories

Sources

  1. NVD
  2. SQLite forum: heap-buffer-overflow in sessionReadRecord
  3. SQLite: Vulnerabilities
  4. Siemens SSA-000297: RUGGEDCOM CROSSBOW SAC
  5. Siemens SSA-794697: SIMATIC S7-1500 TM MFP
  6. Siemens SSA-915275: SINEC INS
  7. Siemens SSA-277137: SIDIS Prime
  8. OpenWrt packages: sqlite3 build options
  9. Debian security tracker
  10. CISA KEV
  11. FIRST EPSS

Frequently asked questions

Does CVE-2023-7104 affect every SQLite build?

No. The bug is in the session extension, which is only present when SQLite is compiled with SQLITE_ENABLE_SESSION, and it needs the application to process a corrupted changeset through the Session C APIs. OpenWrt builds libsqlite3 without it by default (per the SQLite Vulnerabilities page and OpenWrt packages).

Why do NVD and Siemens give CVE-2023-7104 different scores?

NVD scores 7.3 with a network vector and no privileges. VulDB, the CNA, scores 5.5 with an adjacent-network vector and low privileges, and Siemens uses that 5.5 vector in its advisories (per NVD and Siemens ProductCERT).

Which Siemens products are affected by CVE-2023-7104?

RUGGEDCOM CROSSBOW Station Access Controller before V5.6, the SIMATIC S7-1500 TM MFP GNU/Linux subsystem before V1.1, SINEC INS before V1.0 SP2 Update 3 and SIDIS Prime before V4.0.700 (per Siemens SSA-000297, SSA-794697, SSA-915275 and SSA-277137).

Is CVE-2023-7104 in the CISA KEV catalog?

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