Potential fix for code scanning alert no. 19: Disabling certificate validation #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Potential fix for https://github.com/sanibrand-tech/runner/security/code-scanning/19
To mitigate this vulnerability, certificate validation should not be disabled. This means removing or commenting out the line
process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = '0'. By default, Node.js will reject unauthorized certificates, i.e., it will only permit connecting to servers with valid certificates.If the code must connect to a self-signed/test instance, the secure solution is to provide the trusted CA certificate explicitly for validation—not to disable validation outright. Since only the disabling line is shown, the best fix here is to delete/comment that line. No additional imports or supporting changes are strictly needed, but users wanting to connect to services with self-signed certificates should be instructed to configure the
caoption when making requests (see Node.js documentation forhttps.request).Thus, only line 13 needs to be removed or commented out in
src/Misc/layoutbin/checkScripts/downloadCert.js.Suggested fixes powered by Copilot Autofix. Review carefully before merging.