From a0fea4a7a563ff220e9e1c2c78a7822058cc79e8 Mon Sep 17 00:00:00 2001 From: James Fletcher <42464962+jf205@users.noreply.github.com> Date: Thu, 16 Apr 2026 11:45:38 +0100 Subject: [PATCH] Fix for Call to eval-like DOM function Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- foo.js | 168 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 84 insertions(+), 84 deletions(-) diff --git a/foo.js b/foo.js index b84018fc..18bf8520 100644 --- a/foo.js +++ b/foo.js @@ -1,15 +1,15 @@ -document.write(window.location); // alert 1 -document.write(window.location); // alert 2 -document.write(window.location); // alert 3 -document.write(window.location); // alert 4 -document.write(window.location); // alert 5 -document.write(window.location); // alert 6 -document.write(window.location); // alert 7 -document.write(window.location); // alert 8 -document.write(window.location); // alert 9 -document.write(window.location); // alert 10 -document.write(window.location); // alert 11 -document.write(window.location); // alert 12 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 1 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 2 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 3 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 4 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 5 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 6 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 7 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 8 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 9 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 10 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 11 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 12 document.write(window.location); // alert 13 document.write(window.location); // alert 14 document.write(window.location); // alert 15 @@ -127,75 +127,75 @@ document.write(window.location); // alert 126 document.write(window.location); // alert 127 document.write(window.location); // alert 128 document.write(window.location); // alert 129 -document.write(window.location); // alert 130 -document.write(window.location); // alert 131 -document.write(window.location); // alert 132 -document.write(window.location); // alert 133 -document.write(window.location); // alert 134 -document.write(window.location); // alert 135 -document.write(window.location); // alert 136 -document.write(window.location); // alert 137 -document.write(window.location); // alert 138 -document.write(window.location); // alert 139 -document.write(window.location); // alert 140 -document.write(window.location); // alert 141 -document.write(window.location); // alert 142 -document.write(window.location); // alert 143 -document.write(window.location); // alert 144 -document.write(window.location); // alert 145 -document.write(window.location); // alert 146 -document.write(window.location); // alert 147 -document.write(window.location); // alert 148 -document.write(window.location); // alert 149 -document.write(window.location); // alert 150 -document.write(window.location); // alert 151 -document.write(window.location); // alert 152 -document.write(window.location); // alert 153 -document.write(window.location); // alert 154 -document.write(window.location); // alert 155 -document.write(window.location); // alert 156 -document.write(window.location); // alert 157 -document.write(window.location); // alert 158 -document.write(window.location); // alert 159 -document.write(window.location); // alert 160 -document.write(window.location); // alert 161 -document.write(window.location); // alert 162 -document.write(window.location); // alert 163 -document.write(window.location); // alert 164 -document.write(window.location); // alert 165 -document.write(window.location); // alert 166 -document.write(window.location); // alert 167 -document.write(window.location); // alert 168 -document.write(window.location); // alert 169 -document.write(window.location); // alert 170 -document.write(window.location); // alert 171 -document.write(window.location); // alert 172 -document.write(window.location); // alert 173 -document.write(window.location); // alert 174 -document.write(window.location); // alert 175 -document.write(window.location); // alert 176 -document.write(window.location); // alert 177 -document.write(window.location); // alert 178 -document.write(window.location); // alert 179 -document.write(window.location); // alert 180 -document.write(window.location); // alert 181 -document.write(window.location); // alert 182 -document.write(window.location); // alert 183 -document.write(window.location); // alert 184 -document.write(window.location); // alert 185 -document.write(window.location); // alert 186 -document.write(window.location); // alert 187 -document.write(window.location); // alert 188 -document.write(window.location); // alert 189 -document.write(window.location); // alert 180 -document.write(window.location); // alert 191 -document.write(window.location); // alert 192 -document.write(window.location); // alert 193 -document.write(window.location); // alert 194 -document.write(window.location); // alert 195 -document.write(window.location); // alert 196 -document.write(window.location); // alert 197 -document.write(window.location); // alert 198 -document.write(window.location); // alert 199 -document.write(window.location); // alert 200 -document.write(window.location); // alert 201 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 130 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 131 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 132 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 133 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 134 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 135 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 136 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 137 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 138 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 139 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 140 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 141 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 142 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 143 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 144 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 145 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 146 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 147 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 148 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 149 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 150 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 151 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 152 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 153 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 154 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 155 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 156 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 157 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 158 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 159 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 160 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 161 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 162 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 163 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 164 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 165 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 166 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 167 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 168 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 169 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 170 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 171 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 172 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 173 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 174 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 175 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 176 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 177 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 178 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 179 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 180 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 181 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 182 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 183 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 184 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 185 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 186 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 187 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 188 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 189 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 180 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 191 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 192 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 193 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 194 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 195 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 196 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 197 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 198 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 199 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 200 +document.body.appendChild(document.createTextNode(String(window.location))); // alert 201