test1 / index.html
shubhankargaur's picture
Update index.html
d8aefd9 verified
Raw
History Blame Contribute Delete
509 Bytes
<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>