Skip to content

Security: tomtom215/duckdb-behavioral

SECURITY.md

Security Policy

Reporting a Vulnerability

Please report a suspected vulnerability privately, through GitHub's Security Advisory form. Do not open a public issue for it: an issue discloses the problem before a fix exists. For a defect that is not a vulnerability (a wrong result, a crash on valid input), a normal issue is the right place.

Security Model

Attack Surface

This extension operates within DuckDB's process and has no independent attack surface beyond what DuckDB itself exposes. Specifically:

  • No network access -- the extension makes zero network calls at runtime
  • No file system access -- all state is managed in-memory through DuckDB's aggregate function lifecycle
  • No dynamic code execution -- pattern strings are parsed by a deterministic recursive descent parser with no eval-like behavior

Unsafe Code Confinement

All hand-written unsafe code is confined to src/ffi/ (10 files); the extension entry point in src/lib.rs is generated by the quack_rs::entry_point_v2! macro. Business logic in src/sessionize.rs, src/retention.rs, src/window_funnel.rs, src/sequence.rs, src/sequence_next_node.rs, src/common/, and src/pattern/ is 100% safe Rust. The compiler and clippy enforce this: unsafe_code = "deny" everywhere but src/ffi, and in src/ffi clippy::undocumented_unsafe_blocks and clippy::multiple_unsafe_ops_per_block are denied, so every unsafe block is one operation with a // SAFETY: note. The callbacks themselves are safe Rust over the small types in src/ffi/view.rs, which hold the few unsafe constructors and bounds-check every row index. The aggregate update, combine, and finalize callbacks are generated by quack-rs's aggregate_*_callback! macros, which turn a panic into a SQL error instead of crashing DuckDB (the release profile keeps panic = "unwind" for this).

Dependency Audit

The extension has exactly three runtime dependencies: quack-rs = "=0.20.0" and libduckdb-sys = "=1.20000.1" (both pinned exactly) and smallvec = "1" (a caret requirement, locked by Cargo.lock). All dependencies are audited via cargo-deny in CI, and weekly by scheduled.yml, for known advisories and license compliance.

Build Integrity

Release builds use deterministic settings (LTO, single codegen unit, Cargo.lock committed). Release artifacts include SHA256 checksums and GitHub artifact attestations via actions/attest-build-provenance.

For the full security model, see the Security & Supply Chain documentation.

Supported Versions

Version Supported
0.11.x Yes
< 0.11 No

There aren't any published security advisories