Skip to content

Commit 9d9d691

Browse files
Fix security issues in strikes page
Address security issues identified by code scanning: 1. Added integrity and crossorigin attributes to the jQuery script to prevent potential supply chain attacks 2. Fixed regex in getParameterByName function to properly escape backslash characters This PR improves the security of the strikes page that was fixed in PR # 70.
1 parent ac7b5ed commit 9d9d691

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Strikes/my-strikes.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@
108108
}
109109
}
110110
</style>
111-
<script src="//code.jquery.com/jquery-1.12.0.min.js"></script>
111+
<script src="https://code.jquery.com/jquery-1.12.0.min.js"
112+
integrity="sha256-Xxq2X+KtazgaGuA2cWR1v3jJsuMJUozyIXDB3e793L8="
113+
crossorigin="anonymous"></script>
112114
</head>
113115
<body>
114116
<nav class="menu-container">
@@ -172,7 +174,7 @@ <h2>Staff3</h2>
172174
// Parse the URL parameter
173175
function getParameterByName(name, url) {
174176
if (!url) url = window.location.href;
175-
name = name.replace(/[\[\]]/g, "\\$&");
177+
name = name.replace(/[\\[\]]/g, "\\$&");
176178
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
177179
results = regex.exec(url);
178180
if (!results) return null;

0 commit comments

Comments
 (0)