Skip to content

(master) os/access: fix off-by-one in hostname character validation range#2797

Open
metux wants to merge 1 commit into
masterfrom
pr/master-os-access-fix-off-by-one-in-hostname-character-validation-range-_2026-05-18_20-28-53
Open

(master) os/access: fix off-by-one in hostname character validation range#2797
metux wants to merge 1 commit into
masterfrom
pr/master-os-access-fix-off-by-one-in-hostname-character-validation-range-_2026-05-18_20-28-53

Conversation

@metux
Copy link
Copy Markdown
Contributor

@metux metux commented May 18, 2026

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: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2200

@metux metux self-assigned this May 18, 2026
@metux metux requested a review from a team May 18, 2026 18:29
metux pushed a commit that referenced this pull request May 18, 2026
Comment thread os/access.c
}
}
else if (((c >= 0x30) && (c <= 0x3A)) /* 0-9 */ ||
else if (((c >= 0x30) && (c <= 0x39)) /* 0-9 */ ||
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why not use '0', '9', etc?

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: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2200>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
@metux metux force-pushed the pr/master-os-access-fix-off-by-one-in-hostname-character-validation-range-_2026-05-18_20-28-53 branch from 11d5758 to b6ee942 Compare May 19, 2026 17:16
metux pushed a commit that referenced this pull request May 22, 2026
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.

3 participants