From 3c576260f23b4bf9dc311a622f07be93d8a37250 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 17 Apr 2026 10:12:42 +1000 Subject: [PATCH] os/access: fix off-by-one in hostname character validation range In siHostnameCheckAddr(), the digit validation range was 0x30-0x3A, but 0x3A is the colon character (':'). The ASCII range for digits 0-9 is 0x30-0x39. Colons in hostnames violate RFC 2396 section 3.2.2 and we're not parsing the host:port notation here. Assisted-by: Claude:claude-claude-opus-4-6 Part-of: --- os/access.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os/access.c b/os/access.c index 1daa36162..616a84b94 100644 --- a/os/access.c +++ b/os/access.c @@ -1879,7 +1879,7 @@ siHostnameCheckAddr(const char *valueString, int length, void *typePriv) dotAllowed = FALSE; } } - else if (((c >= 0x30) && (c <= 0x3A)) /* 0-9 */ || + else if (((c >= 0x30) && (c <= 0x39)) /* 0-9 */ || ((c >= 0x61) && (c <= 0x7A)) /* a-z */ || ((c >= 0x41) && (c <= 0x5A)) /* A-Z */ ) { dotAllowed = TRUE;