Spaces:
Running
Running
| <script> | |
| // Run before loading iframe-resizer | |
| (function detectProtoPollution() { | |
| const safe = {}; | |
| const marker = "PROTO_POLLUTION_TEST_" + Math.random(); | |
| // Try to pollute | |
| JSON.parse(`{"__proto__": {"${marker}": true}}`); | |
| const polluted = ({}).hasOwnProperty(marker) || safe[marker] === true; | |
| if (polluted) { | |
| console.error("[!] PROTOTYPE POLLUTION DETECTED! Environment is vulnerable."); | |
| } else { | |
| console.log("[+] Safe from __proto__ pollution via JSON.parse"); | |
| } | |
| })(); | |
| </script> |