Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
2367056
Added unit tests for FuzzySetMatch() and ParseHostPort()
victormlg Nov 16, 2026
93ecf30
Extracted MatchPrefix() from FuzzySetMatch()
victormlg Nov 16, 2026
47d645e
Extracted MatchIPv4CIDR() from FuzzySetMatch()
victormlg Nov 16, 2026
9bb2f43
Extracted MatchIPv4Range() from FuzzySetMatch()
victormlg Nov 16, 2026
32085e2
Extracted MatchIPv6CIDR() from FuzzySetMatch()
victormlg Nov 16, 2026
faefd14
Extracted MatchIPv6Range() from FuzzySetMatch()
victormlg Nov 16, 2026
a35d555
Extracted GetPatternNotation() from FuzzySetMatch()
victormlg Nov 16, 2026
c6e2947
Restructured ParseHostPort()
victormlg Nov 16, 2026
078426a
Removed declaration of IsLoopbackAddress()
victormlg Nov 16, 2026
ec2ff05
Fixed IPv6 range patterns comparing groups as decimal numbers
victormlg Nov 16, 2026
473ba52
Fixed IPv6 range patterns excluding the lower bound of a range
victormlg Nov 16, 2026
a55c1cc
IPv6 range patterns now support `::`
victormlg Nov 16, 2026
bc97da1
Fixed bug where IPv4 range patterns reused values from the previous o…
victormlg Nov 16, 2026
f02295c
IPv4 CIDR patterns with an invalid network address, e.g. `bogus/0`, a…
victormlg Nov 16, 2026
a9c77d4
Policy functions `iprange()` and `isipinsubnet()` now detect invalid …
victormlg Nov 16, 2026
2af3afa
Fixed out-of-bounds read in `hostrange()` on all-digit host names
victormlg Nov 16, 2026
97a0e4e
Fixed sys.policy_hub when bootstrapped to a host name starting with a…
victormlg Nov 16, 2026
acda8ce
Renamed address matching functions after their policy functions
victormlg Nov 16, 2026
e3d1a36
Added assert to access_CheckResource()
victormlg Nov 16, 2026
bc62b2d
Replaced strchr() with StringContainsChar() in addr_lib.c
victormlg Nov 16, 2026
2003c09
Replaced strstr() and strcmp() with String*() helpers in addr_lib.c
victormlg Nov 16, 2026
2e725a0
`iprange()` and `isipinsubnet()` now log invalid arguments at verbose…
victormlg Nov 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions cf-serverd/server_access.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "strlist.h"
#include "server.h"

#include <addr_lib.h> /* FuzzySetMatch */
#include <addr_lib.h> /* IPRangeMatch */
#include <string_lib.h> /* StringMatchFull TODO REMOVE */
#include <misc_lib.h>
#include <file_lib.h>
Expand Down Expand Up @@ -73,6 +73,8 @@ static bool access_CheckResource(const struct resource_acl *acl,
const char *ipaddr, const char *hostname,
const char *key, const char *username)
{
assert(acl != NULL);
Comment thread
victormlg marked this conversation as resolved.
Resolved

bool access = false; /* DENY by default */
bool have_match = false; /* No matching rule found yet */

Expand All @@ -90,7 +92,7 @@ static bool access_CheckResource(const struct resource_acl *acl,
const char *rule = NULL;
for (size_t i = 0; i < StrList_Len(acl->admit.ips); i++)
{
if (FuzzySetMatch(StrList_At(acl->admit.ips, i), ipaddr) == 0 ||
if (IPRangeMatch(StrList_At(acl->admit.ips, i), ipaddr) ||
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
/* Legacy regex matching, TODO DEPRECATE */
StringMatchFull(StrList_At(acl->admit.ips, i), ipaddr))
{
Expand Down Expand Up @@ -196,7 +198,7 @@ static bool access_CheckResource(const struct resource_acl *acl,
const char *rule = NULL;
for (size_t i = 0; i < StrList_Len(acl->deny.ips); i++)
{
if (FuzzySetMatch(StrList_At(acl->deny.ips, i), ipaddr) == 0 ||
if (IPRangeMatch(StrList_At(acl->deny.ips, i), ipaddr) ||
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
/* Legacy regex matching, TODO DEPRECATE */
StringMatchFull(StrList_At(acl->deny.ips, i), ipaddr))
{
Expand Down
Loading
Loading