Wazuh fix note · decoders

Wazuh snort decoder cuts the last octet off srcip and dstip (4.14.x): measured, with a local fix

If a snort alert has no source port, Wazuh 4.14.x stores srcip without its last octet (10.4.12.26 becomes 10.4.12), and when the destination has a port it stays glued to dstip. Anything keyed on those fields, such as active response, CDB lists or correlation by IP, works on the wrong value. A local copy of the decoder with three regex lines changed, plus one exclude line in ossec.conf, fixes it today.

Dong Nguyen, ATK New Technology · 22 October 2026 · measured with wazuh-logtest on wazuh-manager 4.14.9 · upstream: #39989, fix #40521 for 4.14.11


Eight samples, three decoders

Stock is ruleset/decoders/0285-snort_decoders.xml as shipped in 4.14.9. "Merged fix" is the three regex lines from PR #40521, which is merged for 4.14.11 but not released. "This page" is the same with one more change, shown below.

sample (after the priority)stock 4.14.9merged fixthis page
{ICMP} 10.4.12.26 -> 10.4.10.231srcip 10.4.12dstip 10.4.10.both correct
{TCP} 10.4.12.26:37020 -> 10.4.10.231:162dstip 10.4.10.231:162correctcorrect
{UDP} 192.168.20.32 -> 192.168.20.2srcip 192.168.20correctcorrect
{TCP} 10.4.12.26:5000 -> 10.4.10.7correctcorrectcorrect
{UDP} 10.4.12.26 -> 10.4.10.7:53srcip 10.4.12, dstip 10.4.10.7:53correctcorrect
{ICMP} 203.113.100.250 -> 198.51.100.200srcip 203.113.100dstip 198.51.100.correct
{TCP} 203.113.100.250:44321 -> 198.51.100.200:443dstip 198.51.100.200:443correctcorrect
[**] multi-line form from the file headerno fieldsno fieldsno fields

Bold means wrong. The stock decoder got two of the seven snort: lines right, the merged fix five, this page all seven. The merged fix still loses the last octet of dstip when there is no destination port and that octet has three digits; we reported the measurement on the PR before 4.14.11 ships. The [**] form is assembled by the snort-full reader across several lines, which a single logtest line does not reproduce, so it is out of scope here.

Fix on 4.14.x today

1. Copy the stock file and change its three <regex> lines in the snort2 decoder to:

<regex>^[**] [(\d+:\d+:\d+)] \.+ (\d+.\d+.\d+.\d+)\p*\d* -> </regex>
<regex>(\d+.\d+.\d+.\d+)\p*\d*|^[(\d+:\d+:\d+)] \.+ </regex>
<regex>(\d+.\d+.\d+.\d+)\p*\d* -> (\d+.\d+.\d+.\d+)</regex>

Save it as /var/ossec/etc/decoders/0285-snort_decoders-fixed.xml, owner wazuh:wazuh.

2. In /var/ossec/etc/ossec.conf, inside <ruleset>, stop the stock file from loading, so the two copies do not compete:

<decoder_exclude>ruleset/decoders/0285-snort_decoders.xml</decoder_exclude>

3. Restart the manager. A new wazuh-logtest session picks the change up without a restart, so you can check first; live analysis needs the restart.

4. After upgrading to 4.14.11 or later, remove both again and re-run your samples: the shipped decoder may or may not include the dstip change above.

Limits. Measured with the logtest engine on 4.14.9, syslog snort: form only. Your snort output may differ (unified2 via barnyard, alert_fast, IPv6); run your own lines before you rely on it.

Check your own lines

Run your snort lines through wazuh-logtest before and after. Or let your AI agent run them on a real 4.14.9 manager through our MCP server: add https://atkvn.com/agent/mcp and ask it to test the decoder above against your lines (test_wazuh_rule). Note that the hosted test cannot change ossec.conf, so it shows the stock and local decoders side by side rather than the exclude. How to connect.