Fixing the use of a library hosted from an untrusted source
The sources of the libraries and components we use must be from a secure and trusted source. The hosts of these libraries, which are most of the time hosted in CDNs, can also be attacked and abused.
Getting ready
We will use the Online Banking app we used in the previous recipe. Using VS Code, open the sample OnlineBankingApp
folder at \Chapter10\untrusted-source\before\OnlineBankingApp\
.
You can perform the steps in this folder to fix the use of a package hosted from an untrusted source.
How to do it…
Let's take a look at the steps for this recipe:
- From the starting exercise folder, launch VS Code by typing the following command:
code .
- Open
Pages\Loans\Index.cshtml
and examine thescript
reference below the markup:<script src="http://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous...