JDK-8257635 : UUID#fromString Accepts Invalid Input
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util
  • Affected Version: 16
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2020-12-02
  • Updated: 2020-12-03
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Cloners :  
Relates :  
Relates :  
Description
A DESCRIPTION OF THE PROBLEM :
All of the following are parsed by UUID#fromString but are actually invalid:

0-0-0-0-0
+0000000-0000-0000-0000-000000000000
00000000-+000-0000-0000-000000000000
00000000-0000-+000-0000-000000000000
00000000-0000-0000-+000-000000000000
00000000-0000-0000-0000-+00000000000
0-0-0-0-0000000000000000000000000000
0000000000000000000000000000-0-0-0-0

Additionally all non-Latin1 digits and leading +/- signs are accepted due to the use of Long.parseLong that
uses Character.digit(ch, 16) to convert from characters.