You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Toml.parse accepts out of range dates and times #9647
Toml.parse doesn't range-check dates and times. Local dates and times with an impossible month, day, hour, minute or second are accepted as is, and an offset date-time with an impossible day or hour is silently moved to a later date. On main (and on v4/next-minor, where it returns Success):
TOML 1.0 requires RFC 3339 values, so all three should fail. The offset case is the worst one, since the document parses and the config just gets the wrong date. Date rolls Feb 30 over to Mar 2 instead of returning an invalid date, so the existing isNaN check never fires.
Running the toml-test 1.0 suite, 21 of the invalid files Toml.parse accepts are of this kind (feb-30, month-over, hour-over, minute-over and so on under datetime, local-date, local-datetime and local-time).
I have a small fix with a test and will open a PR against v4/next-minor.
Activity