Project

General

Profile

Actions

Bug #9059

closed
VJ VJ

lua/hashlib: --disable-hashing is not honored by the Lua hashing API

Bug #9059: lua/hashlib: --disable-hashing is not honored by the Lua hashing API

Added by Victor Julien 2 months ago. Updated 8 days ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Affected Versions:
Effort:
Difficulty:
Label:

Description

  • Status: present in main (9b7938aec); code-confirmed
  • Class: configuration/policy bypass (--disable-hashing not 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).


Subtasks 1 (0 open — 1 closed)

Bug #9309: lua/hashlib: --disable-hashing is not honored by the Lua hashing API (8.0.x backport)ClosedVictor JulienActions
Actions

Also available in: PDF Atom