Skip to content

fix(dpi): refuse IPv6 zones in rule sources - #2036

Merged
Tbaile merged 1 commit into
release-8.9.0from
fix-dpi-source-zone
Nov 20, 2026
Merged

Tbaile merged 1 commit into
release-8.9.0from
fix-dpi-source-zone

Conversation

@gsanchietti

Copy link
Copy Markdown
Member

The problem

A DPI rule can have typed source addresses. An IPv6 address may carry a "zone" after a %, like fe80::1%eth0. Python accepts any text as the zone, so a source like fe80::1%x) || (true passed validation.

That text was copied as is into the rule that netifyd reads:

(local_ip == fe80::1%x) || (true) && (app == 'netify.wikipedia');

netifyd can't parse it. It logs criteria parse error, exits, gets restarted, and fails again. While it loops, no DPI rule is applied at all: one bad source disables every rule on the firewall.

Reproduced on a test unit: after adding such a rule, an application blocked by another, unrelated rule was no longer blocked.

This comes from the typed source validation added with the DPI rework, not from the source objects change.

The fix

  • Sources with a % are refused with invalid_source. A zone has no meaning when matching a local address.
  • A value already saved before the fix, e.g. restored from a backup or synced by an HA peer, has its zone dropped when the netifyd rule is written, so it can't break netifyd anymore.

Tested

  • python3-nethsec tests pass, with new cases for zones.
  • On a unit: the API refuses fe80::1%x) || (true; the same value written directly into the config becomes local_ip == fe80::1, netifyd stays up and the other rules keep blocking.

https://claude.ai/code/session_01MSZ8Qpvy99zcMqD5JUBamg

A typed rule source like fe80::1%x) || (true passed validation, as
Python accepts any text after % as an IPv6 zone. The text was copied
as is into the netifyd rule expression: netifyd failed to parse it,
exited and kept restarting, so no DPI rule was applied anymore.

Refuse sources with a zone, and drop the zone of a value saved before,
e.g. restored from a backup, so it can't break netifyd anymore.

Assisted-by: Claude Code:claude-sonnet-5-5
Claude-Session: https://claude.ai/code/session_01MSZ8Qpvy99zcMqD5JUBamg
@gsanchietti
gsanchietti marked this pull request as ready for review November 20, 2026 15:31
@Tbaile
Tbaile merged commit 75af8bc into release-8.9.0 Nov 20, 2026
7 checks passed
@Tbaile
Tbaile deleted the fix-dpi-source-zone branch November 20, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants