Skip to content

pbr-1.2.4: stop a mistyped address breaking or widening a policy - #209

Merged
stangri merged 1 commit into
mossdef-org:1.2.4from
egc112:pbr-1.2.4-ipv4-no-leading-zero
Nov 9, 2026
Merged

stangri merged 1 commit into
mossdef-org:1.2.4from
egc112:pbr-1.2.4-ipv4-no-leading-zero

Conversation

@egc112

@egc112 egc112 commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

is_ipv4() allowed a leading zero, which nft reads as octal. So 09 or 08 in an octet or prefix passed validation, nft refused the generated file, and one such policy gave "FAILED TO START" with every policy lost.

Refuse leading zeros in is_ipv4(). That alone would make things worse, for two reasons, so two more changes go with it:

  • is_domain() accepted whatever is_ipv4() refused, so a mistyped address became a domain set that dnsmasq can never fill. Four numbers are no longer a domain.

  • policy_process() reported an unknown entry but still wrote the rule, with that side left empty. With no address on a side the rule matches every address, so src_addr 1.2.3.4/33 already sent all traffic down the policy's interface. A side that was configured but kept no usable entry now skips the policy. A side with one good entry keeps it.

dns_policy_process() reported nothing for a bad entry, so it now reports errorPolicyProcessUnknownEntry too. The message already exists, so no compat bump is needed.

A leading zero of 00 to 07 used to load, with the same value. Such an address is now reported and its policy is skipped.

Assisted-by: Claude:claude-opus-5-5

is_ipv4() allowed a leading zero, which nft reads as octal. So 09 or 08
in an octet or prefix passed validation, nft refused the generated file,
and one such policy gave "FAILED TO START" with every policy lost.

Refuse leading zeros in is_ipv4(). That alone would make things worse,
for two reasons, so two more changes go with it:

- is_domain() accepted whatever is_ipv4() refused, so a mistyped address
  became a domain set that dnsmasq can never fill. Four numbers are no
  longer a domain.

- policy_process() reported an unknown entry but still wrote the rule,
  with that side left empty. With no address on a side the rule matches
  every address, so `src_addr 1.2.3.4/33` already sent all traffic down
  the policy's interface. A side that was configured but kept no usable
  entry now skips the policy. A side with one good entry keeps it.

dns_policy_process() reported nothing for a bad entry, so it now reports
errorPolicyProcessUnknownEntry too. The message already exists, so no
compat bump is needed.

A leading zero of 00 to 07 used to load, with the same value. Such an
address is now reported and its policy is skipped.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Erik Conijn <egc112@msn.com>
@stangri
stangri merged commit a35566a into mossdef-org:1.2.4 Nov 9, 2026
3 checks passed
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.

2 participants