Skip to content

proxy: fix 0.0.0.0/0 and ::/0 CIDR matching - #23434

Closed
bagder wants to merge 5 commits into
masterfrom
bagder/cidr-zero-bits
Closed

bagder wants to merge 5 commits into
masterfrom
bagder/cidr-zero-bits

Conversation

@bagder

@bagder bagder commented Oct 16, 2026

Copy link
Copy Markdown
Member

A zero-bit CIDR prefix should match every address in its family.

Adjusted test 1614 to verify.

Reported-by: Bootherr on hackerone

A zero-bit CIDR prefix should match every address in its family.

Adjusted test 1614 to verify.

Reported-by: Bootherr on hackerone
@bagder
bagder requested a balanced review from Copilot October 16, 2026 09:58
@bagder
bagder marked this pull request as ready for review October 16, 2026 09:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new checks also turn exact-address exclusions into wildcards, causing unintended proxy bypass.

2 open findings
What changed in this PR

This PR updates proxy exclusion matching so 0.0.0.0/0 and ::/0 match all addresses in their respective families.

Changes:

  • Adds wildcard handling to IPv4 and IPv6 CIDR matching.
  • Extends unit test 1614 with zero-prefix matching cases.
File Description
tests/​unit/​unit1614.c Adds IPv4 and IPv6 zero-prefix cases.
lib/​proxy.c Adds wildcard checks for zero-address networks.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread lib/proxy.c Resolved
Comment thread lib/proxy.c Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The requested matching behavior is implemented; the retained cleanup is non-blocking.

0 open findings

2 resolved since last review

🧠 Review effort: Balanced

@bagder bagder closed this in be652f3 Oct 16, 2026
@bagder
bagder deleted the bagder/cidr-zero-bits branch October 16, 2026 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants