Bug 62685 - Changes to hostname parsing in HttpParser breaks hostname with trailing dot
Summary: Changes to hostname parsing in HttpParser breaks hostname with trailing dot
Alias: None
Product: Tomcat 9
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 9.0.8
Hardware: PC Mac OS X 10.1
: P2 major with 6 votes (vote)
Target Milestone: -----
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2018-09-06 16:48 UTC by AG
Modified: 2018-09-13 15:56 UTC (History)
2 users (show)

Possible fix with updated test cases (3.44 KB, patch)
2018-09-06 21:03 UTC, AG
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description AG 2018-09-06 16:48:03 UTC
Following fix "Enable strict validation of the provided host name and port for all connectors. Requests with invalid host names and/or ports will be rejected with a 400 response. (markt) " is now restricting the use of trailing dot in hostname.

As per RFC 1034 and information on this site http://www.dns-sd.org/trailingdotsindomainnames.html trailing dot is perfectly valid for a hostname.

The fix is very simple and if needed I can contribute to the fix as well.
Please suggest.
Comment 1 AG 2018-09-06 21:03:11 UTC
Created attachment 36134 [details]
Possible fix with updated test cases

Change in the patch simply allows a hostname to end with a dot.
Comment 2 AG 2018-09-06 21:15:10 UTC
This issue seems to exist for the following versions:
- trunk for 9.0.8 onwards
- 8.5.x for 8.5.31 onwards
- 8.0.x for 8.0.52 onwards
- 7.0.x for 7.0.87 onwards

This is the actual fix that causes hostnames with trailing dot to fail:
Comment 3 Mark Thomas 2018-09-12 14:18:49 UTC
Many thanks for the report, the analysis and the patch.

Fixed in:
- trunk for 9.0.13 onwards
- 8.5.x for 8.5.35 onwards
- 7.0.x for 7.0.91 onwards
Comment 4 AG 2018-09-13 15:56:34 UTC
Very much appreciate for the quick resolution. Will test it again once the new releases are out.