Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

date validation sometimes allows invalid February 29 dates #957

Open
ElectricNroff opened this issue Dec 16, 2022 · 3 comments
Open

date validation sometimes allows invalid February 29 dates #957

ElectricNroff opened this issue Dec 16, 2022 · 3 comments
Assignees

Comments

@ElectricNroff
Copy link
Contributor

Following up on the #817 issue, February 29 is sometimes accepted when the year is not a leap year:

/cve-id?time_reserved.gt=2100-02-29T00:00:00Z
==>
{"cve_ids":[]}
/cve-id?time_reserved.gt=2099-02-29T00:00:00Z
==>
Bad date, or invalid timestamp format: valid format is yyyy-MM-ddTHH:mm:ss or yyyy-MM-ddTHH:mm:ss.ZZZZ

but 2100-02-29 is equally bad because 2100 is not a leap year:
anveshkolluri93/validate-date#4

@slubar
Copy link
Contributor

slubar commented Apr 24, 2023

The dates above return empty lists because there are no CVE IDs for 2099 or 2100. If the endpoint is called with the timestamp 2022-02-29T00:00:00Z, an invalid timestamp error is thrown

@ElectricNroff
Copy link
Contributor Author

The envisioned desired behavior is that a time_reserved.gt=2100-02-29T00:00:00Z request should return an error, and should not cause the application to look for anything in the Cve-Id collection. (It is possible that, in March 2100, someone would have reserved a new CVE-2023-xxxxx ID.) The day 2100-02-29 does not exist (most years divisible by four will be leap years, but 2100 won't be a leap year). You can also WONTFIX this issue because there are no known use cases for 2100. Realistically, it would only affect users who deploy their own copy of the cve-services application and decide to advance the clock on their server to more than 70 years in the future.

@anveshkolluri93
Copy link

anveshkolluri93 commented Jul 21, 2023

@ElectricNroff The underlying issue in validate-date library has been fixed. Please, upgrade and retry. Thanks!

Pull Request

@david-rocca david-rocca self-assigned this Dec 4, 2023
jdaigneau5 added a commit that referenced this issue Dec 11, 2023
Resolves issue #958 and #957 - Move away from validate-date to luxon
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

No branches or pull requests

4 participants