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

check json files with jq #3

Merged
merged 1 commit into from
Sep 9, 2024
Merged

check json files with jq #3

merged 1 commit into from
Sep 9, 2024

Conversation

quarckster
Copy link
Contributor

@quarckster quarckster commented Sep 9, 2024

I added a simple JSON validator with jq utility. The script iterates over json files and exits with an error if any of JSON files in secjson is not valid. E.g.:

jq: parse error: Invalid numeric literal at line 23, column 60
Error in file: secjson/CVE-2009-3555.json
jq: parse error: Invalid literal at line 6, column 45
Error in file: secjson/CVE-2022-4450.json
jq: parse error: Invalid numeric literal at line 57, column 1068
Error in file: secjson/CVE-2024-6119.json

@quarckster quarckster changed the title add super linter check json files with jq Sep 9, 2024
@quarckster quarckster closed this Sep 9, 2024
@quarckster quarckster reopened this Sep 9, 2024
@quarckster quarckster merged commit 6fa3b92 into main Sep 9, 2024
@quarckster quarckster deleted the lint branch September 9, 2024 12:52
@levitte
Copy link
Member

levitte commented Sep 9, 2024

Er... did you look at those JSON files?

"value": "Implement RFC5746 to address vulnerabilities in SSL/TLS renegotiation."

"defaultStatus": "unaffected",

"value": "Issue summary: Applications performing certificate name checks (e.g., TLS<br>clients checking server certificates) may attempt to read an invalid memory<br>address resulting in abnormal termination of the application process.<br><br>Impact summary: Abnormal termination of an application can a cause a denial of<br>service.<br><br>Applications performing certificate name checks (e.g., TLS clients checking<br>server certificates) may attempt to read an invalid memory address when<br>comparing the expected name with an `otherName` subject alternative name of an<br>X.509 certificate. This may result in an exception that terminates the<br>application program.<br><br>Note that basic certificate chain validation (signatures, dates, ...) is not<br>affected, the denial of service can occur only when the application also<br>specifies an expected DNS name, Email address or IP address.<br><br>TLS servers rarely solicit client certificates, and even when they do, they<br>generally don't perform a name check against a reference identifier (expected<br>identity), but rather extract the presented identity after checking the<br>certificate chain. So TLS servers are generally not affected and the severity<br>of the issue is Moderate.<br><br>The FIPS modules in 3.3, 3.2, 3.1 and 3.0 are not affected by this issue."

I think your jq version is drunk

@levitte
Copy link
Member

levitte commented Sep 9, 2024

I can see in actions that two of those errors are indeed reported for the current main branch.
jq is wrong, this shouldn't have been merged without scrutinizing the "errors"

@levitte
Copy link
Member

levitte commented Sep 9, 2024

(jq on my laptop doesn't report any error, but I probably have a newer version)

@quarckster
Copy link
Contributor Author

I was testing how the json linter works and intentionally broke some of the files. Then I reverted changes and merged the PR.

@levitte
Copy link
Member

levitte commented Sep 9, 2024

Thank you

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

Successfully merging this pull request may close these issues.

3 participants