Bug #9059
closedlua/hashlib: --disable-hashing is not honored by the Lua hashing API
Description
- Status: present in
main(9b7938aec); code-confirmed - Class: configuration/policy bypass (
--disable-hashingnot honored) - Component:
src/util-lua-hashlib.c(Lua hashing API)
Description¶
--disable-hashing sets g_disable_hashing (src/suricata.c:218, set at :1749) and is enforced by transforms (rust/src/transform/hash.rs), file hashing (src/util-file.c:183-199), JA3/JA4 (src/app-layer-ssl.c:3169+) and email hashing. The Lua suricata.hashlib module never checks it, so a script can still compute md5/sha1/sha256 on arbitrary (packet-derived) data while the operator believes hashing is disabled. The userguide describes the option as disabling those hash algorithms (partials/options.rst:236-238).
Impact: policy/CPU-cost bypass, no memory safety.
Fix direction¶
Honor g_disable_hashing in the Lua hashlib entry points (raise an error or return nil, consistent with the transform behavior); document the interaction.
Test¶
lua-hashlib-disable-hashing: run with --disable-hashing and assert the documented behavior for md5_hexdigest/sha256 (error or nil).
VJ Updated by Victor Julien about 2 months ago
- Status changed from New to In Progress
- Assignee changed from OISF Dev to Victor Julien
JI Updated by Jason Ish about 1 month ago
- Status changed from In Progress to In Review
MR1382