News for hackers. Stuff that matters.
Re:Chrome zero-day released on GitHub – fixed on V8 but stil... by lxe on Monday April 12, 2021 @08:36PM (#26786876)
Re:Chrome zero-day released on GitHub – fixed on V8 but stil... by heljara on Tuesday April 13, 2021 @03:42AM (#26789266)
Broadly speaking, the wasm stuff is only there as a method of getting the browser to execute shellcode, its a pretty standard lump of code for turning a memory bug into code execution in v8. What this shellcode does is open calculator when the browser's sandbox is disabled (`--no-sandbox`). In general in v8 exploitation, once you've reached a point where you can read and write arbitrary memory, you find that v8 will only create either RW or RX pages for you when the JIT compilation happens. WASM is a neat little trick for getting a handle to a RWX page.

At first glance to me, the core bug is actually in abusing an array enough to get an unsigned int into a function that expects them all to be signed, causing an off-by-one error and leveraging that into a memory leak (to get the pointer to a FixedArray for floats and a pointer to a FixedArray of objects) and then replacing one with another to create a type confusion and read/write arbitrary memory through that. r4j will probably correct me on the subtlety here though!

Source: extremely similar to HackTheBox RopeTwo, which I spent more time than I am prepared to admit solving.

Disclaimer: am noob at v8 exploitation, but have done enough of it to know some of the tricks.

See also, an article that helped me previously, much of the code is similar (eg: the WASM stuff, the addrof() and fakeobj() methods): https://faraz.faith/2019-12-13-starctf-oob-v8-indepth/

Re:Chrome zero-day released on GitHub – fixed on V8 but stil... by baybal2 on Tuesday April 13, 2021 @07:22AM (#26790748)
> In general in v8 exploitation, once you've reached a point where you can read and write arbitrary memory, you find that v8 will only create either RW or RX pages for you when the JIT compilation happens. WASM is a neat little trick for getting a handle to a RWX page.

It's not a neat trick, but a grave problem of WASM model.

WASM memory (in)security will be a big problem until all of memory security tricks from native code will be migrated to WASM world, and then there will be not much use of WASM anymore.

Re:Chrome zero-day released on GitHub – fixed on V8 but stil... by kmfpl on Tuesday April 13, 2021 @11:31AM (#26793641)
You understand that having W^X protections on any JIT area is fairly useless without a strong CFI model in place right? Any attacker could easily execute a ROP/JOP chain to switch JIT protections to RX or even more simply allocate an RWX area where the shellcode can be copied and executed.
Re:Chrome zero-day released on GitHub – fixed on V8 but stil... by baybal2 on Tuesday April 13, 2021 @12:21PM (#26794683)
Yes, and this is the part of the problem of the general direction of JS ecosystem development.

JS promoters want so hard for JS to subplant other major languages, but not noticing themselves ignoring the decades long other path major languages took on robustness, and security.

Re:Chrome zero-day released on GitHub – fixed on V8 but stil... by mettamage on Tuesday April 13, 2021 @07:49AM (#26790944)
Wanna play htb together at some point?

My email is in my profile.

Re:Chrome zero-day released on GitHub – fixed on V8 but stil... by thatsnotmepls on Tuesday April 13, 2021 @08:02AM (#26791042)
How the heck people discover these kind of obscure bugs?
Re:Chrome zero-day released on GitHub – fixed on V8 but stil... by graderjs on Monday April 12, 2021 @09:07PM (#26787086)
I ran both the exploits[0][1] on Chrome (89.0.4389.114) on Windows and got

AW SNAP: Access violation on both.

I then straced the tab processes on Debian (as best as I could guess which chrome child processes were tabs via top activity as I loaded stuff in them) and ran the exploit. Nothing seemed unusual. Just all the system calls stopped after the exploit was run, and the tab crashed. I guess it would be good to gdb to the actual JS VM process and stepi through the instructions, but I don't know how to get the actual process that runs the JSVM for a chrome tab.

I forked the repo so I could easily run it from a GitHub pages site. I don't know what it does but I don't think it does anything:

[0]: https://dosycorps.github.io/exploits/chrome-exploit/exploit....

[1]: https://dosycorps.github.io/exploits/chrome-0day/exploit.htm...

Re:Chrome zero-day released on GitHub – fixed on V8 but stil... by rezonant on Tuesday April 13, 2021 @07:14AM (#26790691)
As others have mentioned, this doesn't have a sandbox escape so you need to run with --no-sandbox for the exploit to work
Re:Chrome zero-day released on GitHub – fixed on V8 but stil... by mappu on Monday April 12, 2021 @08:56PM (#26787022)
I converted it to binary with a pack("L", ...) loop and loaded it in Ghidra as a raw x86_64 binary. I don't fully understand it, but i think it's searching the address space for some kind of function entry point and then calling it with "calc.exe".

So probably the standard PoC shellcode.

Re:Chrome zero-day released on GitHub – fixed on V8 but stil... by lights0123 on Monday April 12, 2021 @08:59PM (#26787038)
For anyone else wanting to analyze this:

    echo '\xfc\x48\x83\xe4\xf0\xe8\xc0\x00\x00\x00\x41\x51\x41\x50\x52\x51\x56\x48
\x31\xd2\x65\x48\x8b\x52\x60\x48\x8b\x52\x18\x48\x8b\x52\x20\x48\x8b\x72\x50\x48 \x0f\xb7\x4a\x4a\x4d\x31\xc9\x48\x31\xc0\xac\x3c\x61\x7c\x02\x2c\x20\x41\xc1\xc9 \x0d\x41\x01\xc1\xe2\xed\x52\x41\x51\x48\x8b\x52\x20\x8b\x42\x3c\x48\x01\xd0\x8b \x80\x88\x00\x00\x00\x48\x85\xc0\x74\x67\x48\x01\xd0\x50\x8b\x48\x18\x44\x8b\x40 \x20\x49\x01\xd0\xe3\x56\x48\xff\xc9\x41\x8b\x34\x88\x48\x01\xd6\x4d\x31\xc9\x48 \x31\xc0\xac\x41\xc1\xc9\x0d\x41\x01\xc1\x38\xe0\x75\xf1\x4c\x03\x4c\x24\x08\x45 \x39\xd1\x75\xd8\x58\x44\x8b\x40\x24\x49\x01\xd0\x66\x41\x8b\x0c\x48\x44\x8b\x40 \x1c\x49\x01\xd0\x41\x8b\x04\x88\x48\x01\xd0\x41\x58\x41\x58\x5e\x59\x5a\x41\x58 \x41\x59\x41\x5a\x48\x83\xec\x20\x41\x52\xff\xe0\x58\x41\x59\x5a\x48\x8b\x12\xe9 \x57\xff\xff\xff\x5d\x48\xba\x01\x00\x00\x00\x00\x00\x00\x00\x48\x8d\x8d\x01\x01 \x00\x00\x41\xba\x31\x8b\x6f\x87\xff\xd5\xbb\xf0\xb5\xa2\x56\x41\xba\xa6\x95\xbd \x9d\xff\xd5\x48\x83\xc4\x28\x3c\x06\x7c\x0a\x80\xfb\xe0\x75\x05\xbb\x47\x13\x72 \x6f\x6a\x00\x59\x41\x89\xda\xff\xd5\x63\x61\x6c\x63\x2e\x65\x78\x65\x00' > exploit
Re:Chrome zero-day released on GitHub – fixed on V8 but stil... by dang on Tuesday April 13, 2021 @01:24AM (#26788397)
I had to put some whitespace in your echo because it was borking the page layout. Sorry—it's our bug.
Re:Chrome zero-day released on GitHub – fixed on V8 but stil... by saagarjha on Tuesday April 13, 2021 @05:44AM (#26790115)
(Disclaimer: I know very little about Windows, I Googled a bunch of stuff so the details might be wrong. Disassembly, if you want to follow along: http://shell-storm.org/online/Online-Assembler-and-Disassemb...)

The program program is shellcode, so the first thing it does is set itself up with the state it needs. This includes clearing the direction flag, aligning the stack to 16 bytes, and figuring out where it is in memory (the call to 0xca both sticks an address on the stack and avoids some code described below). It then calls into a little subroutine (at 0xa) to read through the PEB → LoaderData → InMemoryOrderModuleList. The first entry is the entry for the main binary, from which it grabs the "FullDllName", does some sort of trivial hash on it, and compares it to a known value (presumably a check to see that it's running in a sane environment?) Then it largely skips the next entry (ntdll.dll) and goes to kernel32.dll, where it looks into the exports table to find what is presumably CreateProcessA (this is done using a similar hashing scheme, so the string is not directly present in the shellcode). There's a "calc.exe" string at the end of the code (perhaps you can spot it) and with that it has enough to pop a calc.

Re:Chrome zero-day released on GitHub – fixed on V8 but stil... by tyingq on Monday April 12, 2021 @10:36PM (#26787574)
Minor nit, but I suppose you mean "echo -ne" ?
Re:Chrome zero-day released on GitHub – fixed on V8 but stil... by jwilk on Tuesday April 13, 2021 @08:47AM (#26791443)
I guess the newline that echo without -n would add doesn't matter that much.

OTOH -e, depending on your shell, is either necessary (e.g. bash), or unnecessary but harmless (e.g. zsh) or insufficient (e.g. dash). If you want to print binary stuff portably, you need to use printf(1).

(Shameless plug: you can use https://github.com/jwilk/printfify to generate printf commands for binary files.)

In this case, base64 encoding is much more efficient:

  /EiD5PDowAAAAEFRQVBSUVZIMdJlSItSYEiLUhhIi1IgSItyUEgPt0pKTTHJSDHArDxhfAIs
  IEHByQ1BAcHi7VJBUUiLUiCLQjxIAdCLgIgAAABIhcB0Z0gB0FCLSBhEi0AgSQHQ41ZI/8lB
  izSISAHWTTHJSDHArEHByQ1BAcE44HXxTANMJAhFOdF12FhEi0AkSQHQZkGLDEhEi0AcSQHQ
  QYsEiEgB0EFYQVheWVpBWEFZQVpIg+wgQVL/4FhBWVpIixLpV////11IugEAAAAAAAAASI2N
  AQEAAEG6MYtvh//Vu/C1olZBuqaVvZ3/1UiDxCg8BnwKgPvgdQW7RxNyb2oAWUGJ2v/VY2Fs
  Yy5leGUA
Re:Chrome zero-day released on GitHub – fixed on V8 but stil... by edoceo on Monday April 12, 2021 @08:57PM (#26787025)
Repo leads to this one from a few days ago, looks similar, maybe can help?

https://github.com/r4j0x00/exploits/tree/7ba55e5ab034d058774...

Re:Chrome zero-day released on GitHub – fixed on V8 but stil... by alpb on Monday April 12, 2021 @10:30PM (#26787542)
Visibly, it launches calc.exe on Windows. But only reproes if launches as file:///
Re:Chrome zero-day released on GitHub – fixed on V8 but stil... by r4j0x00 on Tuesday April 13, 2021 @03:31AM (#26789176)
Nope, it will also work with a http url. Just run chrome.exe with --no-sandbox flag