Repository navigation
logging: Reject out-of-range ip_mask CIDRs - #8241
Merged
francislavoie merged 1 commit intoOct 19, 2026
Merged
Conversation
jayhemnani9910
force-pushed
the
fix-ip-mask-cidr-range
branch
from
October 18, 2026 08:18
ee1cadd to
2b7bf30
Compare
francislavoie
approved these changes
Oct 19, 2026
francislavoie
enabled auto-merge (squash)
October 19, 2026 05:45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #8240
ip_maskaccepted any integer as a CIDR size. A value outside 0-32 (IPv4) or 0-128 (IPv6) madenet.CIDRMaskreturn nil, and every address of that family was then logged as<nil>.Provisionnow returns an error for those values, socaddy validateandcaddy runreport it instead.This does not change what happens to a family with no size set; that question is in the issue.
Test:
TestIPMaskInvalidCIDRchecks that 33, -1 (IPv4) and 129, -8 (IPv6) fail to provision, and that 32/128 leave addresses unchanged. It fails without the change.go test ./...passes, golangci-lint reports 0 issues formodules/logging.Manual check: with
ip_mask 33, v2.11.7 says "Valid configuration" and logsremote_ipas<nil>; with the change,caddy validatefails withinvalid IPv4 mask: 33 (must be between 0 and 32).Assistance Disclosure
AI used (Claude Code).