multi-language-al-folio icon indicating copy to clipboard operation
multi-language-al-folio copied to clipboard

Fix code scanning alert no. 8: Use of `Kernel.open` or `IO.read` or similar sinks with a non-constant value

Open george-gca opened this issue 1 year ago • 1 comments

Fixes https://github.com/george-gca/multi-language-al-folio/security/code-scanning/8

To fix the problem, we should replace the use of URI.open with a safer alternative that does not call Kernel.open internally. Specifically, we can use Net::HTTP to perform the HTTP request and read the file content. This approach avoids the security risks associated with URI.open.

  1. Replace the URI.open call with Net::HTTP to fetch the content of the URL.
  2. Update the download_file method to use Net::HTTP for downloading the file.
  3. Ensure that the new implementation maintains the existing functionality of downloading the file and saving it to the specified destination.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

george-gca avatar Sep 24 '24 19:09 george-gca

Deploy Preview for multi-language-al-folio failed. Why did it fail? →

Name Link
Latest commit 6eb78c53143cc32fc6b5983db262e29714ce1975
Latest deploy log https://app.netlify.com/sites/multi-language-al-folio/deploys/66f311542153a000082cc022

netlify[bot] avatar Sep 24 '24 19:09 netlify[bot]