malwaredb_pg
PostgreSQL extension for MalwareDB similarity functions: SSDeep, LZJD, and TLSH
malwaredb_pg · PostgreSQL extension for MalwareDB similarity functions: SSDeep, LZJD, and TLSH
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100868 | malwaredb_pg | malwaredb_pg | 0.0.1 | RAG | Apache-2.0 | Rust |
PostgreSQL · 13, 14, 15, 16, 17, 18
Usage
Sources:
malwaredb_pg 0.0.1-dev exposes comparison functions for BWMD, LZJD, SSDeep, and TLSH malware digests. It is explicitly a work in progress.
Verify and compare
The identical SSDeep example returns 100. LZJD and SSDeep use larger values for greater similarity, while BWMD and TLSH use smaller values for greater similarity. Do not mix their scales.
Caveats
- The comparison functions are not strict. Null inputs return algorithm-specific sentinels: 1.0 for BWMD, 0 for LZJD and SSDeep, and the largest signed 64-bit integer for TLSH.
- Invalid encoded digests and unequal BWMD array lengths take Rust panic paths that surface as database errors. Validate formats and dimensions before calling them.
- Null elements in BWMD arrays are treated as zero, which can hide missing data.
- Functions calculate in the calling backend and provide no operator class or index acceleration. Bound input size and query volume.
- The extension is untrusted, requires superuser installation, and tracks fast-moving Rust and pgrx dependencies. Pin and test the complete build for the exact PostgreSQL major.