Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f2178fc

Browse filesBrowse files
bradh352bengl
authored andcommitted
deps: cares: cherry-pick b5a3d96
Original commit message: Asterisks should be allowed in host validation as CNAMEs may reference wildcard domains CloudFlare appears to use this logic in CNAMEs as per #42171 Fixes: c-ares/c-ares#457 Fix By: Brad House (@bradh352) PR-URL: #42216 Fixes: #42171 Fixes: #457 Refs: c-ares/c-ares#457 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michael Dawson <midawson@redhat.com>
1 parent e7b8d83 commit f2178fc
Copy full SHA for f2178fc

File tree

Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed
Open diff view settings
Collapse file

‎deps/cares/src/lib/ares_expand_name.c‎

Copy file name to clipboardExpand all lines: deps/cares/src/lib/ares_expand_name.c
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,16 @@ static int ares__isprint(int ch)
6464
* - underscores which are used in SRV records.
6565
* - Forward slashes such as are used for classless in-addr.arpa
6666
* delegation (CNAMEs)
67+
* - Asterisks may be used for wildcard domains in CNAMEs as seen in the
68+
* real world.
6769
* While RFC 2181 section 11 does state not to do validation,
6870
* that applies to servers, not clients. Vulnerabilities have been
6971
* reported when this validation is not performed. Security is more
7072
* important than edge-case compatibility (which is probably invalid
7173
* anyhow). */
7274
static int is_hostnamech(int ch)
7375
{
74-
/* [A-Za-z0-9-._/]
76+
/* [A-Za-z0-9-*._/]
7577
* Don't use isalnum() as it is locale-specific
7678
*/
7779
if (ch >= 'A' && ch <= 'Z')
@@ -80,7 +82,7 @@ static int is_hostnamech(int ch)
8082
return 1;
8183
if (ch >= '0' && ch <= '9')
8284
return 1;
83-
if (ch == '-' || ch == '.' || ch == '_' || ch == '/')
85+
if (ch == '-' || ch == '.' || ch == '_' || ch == '/' || ch == '*')
8486
return 1;
8587

8688
return 0;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.