Mitigating DOM clobbering attacks in JavaScript