Dear viewer, these subtitles were generated by a machine via the service Trint and therefore are (very) buggy. If you are capable, please help us to create good quality subtitles: https://c3subtitles.de/talk/858 Thanks!
OK, everyone, as of now, please
join me in welcoming Eric,
who is a Ph.D. student at the few
in Amsterdam, and he will talk about
ASALA.
Please give him a warm round of applause.
Hello.
Uh, like the Herald said, I'm Eric,
uh, a
student, uh, at The View and I'm some,
uh, at the Facebook group,
uh, and I'll be presenting work that
we have done, uh, in the group
today.
Uh,
uh, but, uh,
the work, uh, I'm presenting, uh,
most of the work has been done by Ben and
Coffee and by Stephane,
who, uh,
will showed that the attack that I'm
presenting is applicable to,
uh, to,
uh, twenty all twenty two
micro c.p.u micro architectures
that he's tested.
So, uh,
credits to them.
Uh, I tried to sneak this slide in all
my talks, uh, but,
uh, this time is especially apt
because, uh, this talk is about
finding them.
Um,
so the stock is but, uh,
attacking a seller,
uh, which is short for, uh,
uh, aerospace, uh, layered randomization.
It's, uh, an export mitigation
technique which, uh, as
far as deployment concerned is
is one of the success stories.
Uh, uh, since it's
been introduced, it's, uh, widely
been it's been widely adopted.
Uh, and it makes, uh,
exploit, uh, exploitation,
uh, somewhat,
uh, more difficult.
Um, the way
eSolar, uh,
makes it more difficult is that it, uh,
changes the location, uh,
of code and data, uh,
usually every time
the process is run so that an attacker,
uh, uh, cannot
rely on certain addresses to be
the same, uh, all the time.
So, uh, on
the modern 64 bit architecture,
the, um, the aerospace usually is,
uh, forty eight,
uh, bits, which
means there is about, uh,
you can address about, uh, two
hundred and fifty six terabytes
of memory.
Of course, um
this memory is not uh.
Yeah. You cannot write everywhere,
uh or read everywhere
because your computer probably doesn't
have that much memory.
So in reality,
um, only a very small portion
of the memory is allocated
to a process.
And, uh, so it's quite
easy to, uh, change the
location of this memory.
So it makes life for
the expert a tiny bit
more difficult, uh, because
it's very useful for, uh,
to know the location of data.
For example, if you want to override the
return address on the stack,
then it's nice to know where you can jump
to. And of course, you don't.
If you don't know, you might jump
into nowhere and then the program
crashes.
However, um, uh,
yeah. That not much is needed
to, uh, to
for this mitigation.
You just need to like location
of the memory.
Uh, so I really like this acronym.
Um so
you can try to reuse
the book that you can use to exploit
to.
Um, uh,
to first leak information and then
exploit or if that's not possible,
you'll have to find another book
which allows you to leak this.
Uh, yeah, a location
or maybe you don't have to.
So this presentation is about an
attack, uh, which uses,
uh, side channel, uh,
from JavaScript.
Uh, this, uh, um, on
the on processors in the hardware itself
to discover information about, uh,
uh, locations of of data
or code in memory.
So, uh, the modern CPU
architecture is, uh, is
a wondrous abstraction, uh,
layer.
Um.
Uh, um, so even
if you as a programmer, write machine
code, there's lots of stuff
you don't have to worry about,
uh, especially stuff
to make, uh.
Especially stuff to make here.
Um, now
you're programed to fast, uh, memory
exercises are very slow on, uh,
uh, uh, compared to your
CPU on modern, uh,
computers.
And, uh, that's why there is a
cache mechanism, uh,
cache mechanism built in.
So.
Other things are also abstracted
away, for example, if, uh,
your program doesn't let me access,
the data is written to
the cash, but where is it written?
Your program gives a virtual address.
Uh.
Uh, to give
a gift of a virtual address to,
uh, uh,
to the CPU, which then
and the CPU needs to translate that to a
physical address, uh,
which is done by, uh, components
called the Memory Memory Management Unit.
Um, so the memory
management unit has a small cache of
of of mappings from pages to,
uh, from physical memory to,
uh, from to memory to physical memory.
But if, um, if
that's not, uh, if
an address is not in the cache,
it has to do a page table work.
Um, and, uh, the
page table work is what we are, uh,
going to, uh, try to
attack and we'll use
we'll measure the effect the
work will have on the uh
uh, l cache, the last
and biggest cache in the CPU
to.
Um, uh,
to find out what's happening in the,
uh, during the Civil War, OK,
so we're talking about doing, uh,
a timing attack,
uh, from JavaScript, uh,
and to measure whether memory
gets accessed. So,
uh, which means that we need a pretty
good timer to be able to do this.
Uh.
Luckily for us, the browser,
um, uh, standards
committees have come up with,
uh, an API to just
do that so you can take
a timestamp, do an operation
and then take another timestamp
and then you get a very crisp time
measurement
until someone published
a paper, uh, which.
Um, which which showed
basically that you can do a
lot of attack on the,
um, uh, and
and, uh, on the C.P.U
and discover some things.
So the browser makers made
the measurements much more
granular. So every microsecond
or so, uh, you get a
little bump and then for one microsecond,
nothing, uh, nothing changes.
Um, but all is not lost for the attacker,
because you can now
do yeah, you can turn the
coarse grains, uh,
timer into a fine-grained timer.
What you can do, for example, is wait for
this bump to happen and
then quickly do an operation and then
start a counter.
And then depending on how long the
operation takes you, um,
the, uh,
the longer the operation takes,
the smaller to the count.
Uh uh uh
is when the when the.
When the jump happens,
so in Chrome, they chose to
ferry the ferry the length
of of of of the time when
the when this happens.
So, uh,
uh, but still you can do multiple
measurements and then you take an average
and then you can still get the good
measurements.
However, we can do better.
So the, uh,
the browser makers decided.
Um, to to make
this a bit more difficult, but, um,
where the where they where
the standard, um,
when the Standards Committee
Committee, uh, uh,
take a uh they also
give us so, uh,
they decided to implement, uh,
uh, an object called, uh, the
shared array buffer,
uh, which allows, uh,
multiple threats which are called
by bureaucrats, uh, in JavaScript
to work on a single piece of memory.
And, uh, they decided to,
uh, enable this by default, uh,
which is actually, uh, after
we publish the attack.
So I don't yeah.
They, uh, basically have given
up on, uh, given
up on, uh, preventing uh
uh, no second scale type
measurements in, um.
In JavaScript, so that
the shared Arabo four can be used for
other things, but I'll not talk about
this today.
So how can we
use how can we measure, um,
time using shared memory?
Well, it's quite simple.
Uh, one thread is
used for doing the timer measurement.
Uh, and the other thread, uh, does
the operation and, um, so
when the, uh,
when the thread, which is the
operation, um, you
know, the timer threat waits until
the threat of which does
operation, uh,
is ready to do the operation and
then uh yeah.
It sets uh furball and
thus starts the operation.
Meanwhile, uh, the
um the counterthreats, uh,
the timer threat, uh.
Sees that that the shared buffer has
changed and we'll start counting
and then when the operation is done.
Uh, the the, um,
the the the second threat
changes the buffer again and then,
um.
Uh, the counterthreats, uh,
uh, stops, so this gives
a very crisp measurement.
Uh, so now we have a nanosecond,
uh, scale timer,
uh, and we can do is a text from
JavaScript.
Um, so we'll
be, uh, doing a,
uh, attack
by, uh, on the last level
cash and, uh, when
you, uh, exercise,
exercise, memory.
Everything, um.
Uh, is in, uh,
um.
On the granularity of a cash line and
which is sixty four bytes,
uh, within, uh,
for example, the level of free cash, um,
a certain physical address
maps onto a certain cash.
Keshet.
And this, um, this cash that
can, uh, for example,
on, uh, on, uh, Fourcade
desktop machine, uh
uh, contains 16
different cash lines.
Um, and I'll, uh,
I'll talk about, uh,
a modern Internet machine.
But, uh, the concept translates
to, uh,
you know, also to other,
uh, micro architectures.
So, uh,
there are Bercaw.
There are, uh, two
thousand and forty eight Koshetz,
uh, which are
called a slice.
And so they're on the forecourt
machine.
You have four slices and these slices
are shared among all, of course.
But it's just the way Intel
has organized their cash.
Uh, so, uh,
to get, um, the cash that id so
which gets set within the slice,
uh, is used,
you take the physical address
and then you discard the six bits
which, uh, are basically
telling you which byte within the cash
line you use and then take
the eleven bits next
and that is the cash set.
So it's basically a round-robin
mapping of the physical map memory.
Uh, the, the slice
is some complicated,
uh, hash function and for this attack we
don't need it. So we're lucky.
The important thing to
remember is that the cash if to cash,
that's, uh, cash lines.
If a physical memory map to the same cash
that, uh, they have the same,
uh, offsets.
Uh, uh, yes.
Uh, so the same physical address,
if you only, uh.
Only, uh, regard the bits which
are, uh, um.
Yeah, so, uh,
so so they
only regard the lowest bits so that
every one that there have
the same address modulo one
hundred and twenty eight K
kilobyte.
So from which follows
that they also must have the same address
modulo four kilobyte.
And which happens to be the size of
a memory page, which is, um,
the base unit of, uh.
Of memory management on
almost all architectures, I guess,
in use.
So, um,
now we know this, uh,
we can do, uh, cachaÃ§a
channel attack and there are multiple,
multiple attacks possible and we'll
probably use the most simple one
called effect, effect and time.
So the code to do
the effect and time attack is
also quite simple.
Uh, you have an effect function which,
uh, uses a buffer
and just accesses cache lines
which map into a certain cache
that and we
can just do that by accessing,
uh, the cache line,
which, um,
at a certain offset of a page, which we
just we've just seen.
And at this point,
um, all the cash lines.
Uh, should be, uh,
filled with, um,
with our data, so
then we proceed to do an operation, we do
take a timestamp, we do an operation
and we time how long this takes
if this operation needs to
do something with, uh, with, uh,
physical memory.
Uh, uh,
uh, Keshet, which maps
into this, um,
a cache line, a physical memory which
maps into this cache that it will take
longer because we'll have to do a memory
access and memory accesses are really
slow, uh, uh,
compared to the CPU or uh,
uh, cache hits on modern
computers.
So this way, we we can
see if this operation depends
on the physical, uh, memory
location in which maps into this Keshet.
So how does this apply, uh,
to the page war, which will attack?
Um, so
both are mechanism are
the mechanism for,
uh, uh,
processors to, uh,
address a really large
aerospace while only,
uh, having a relatively small
amount of physical memory.
So it's basically a tree structure
with tables at every level
which divide up the space into
equal parts.
So the first level, uh,
on Intel, which is
called the fourth level, is, uh,
because there are four levels.
Well, so, um.
The, um.
The fights aerospace up
into chunks of 512
gigabytes, the next, uh,
level, which could
be five hundred and twelve entries, but I
don't don't have to be
the fight the other
space into one gigabyte chunks,
done into a megabyte chunks and then
lastly into four kilobyte
chunks, which is the granularity of a
page.
So each entry in there
points to a memory page, a physical
memory page.
So what the pitch, uh,
table work process does
is it takes the address and
we'll look at it.
We'll, uh, use this, uh,
we'll use,
uh, a binary representation
of this address because that's, uh,
easier, uh, makes it easier to show the
process.
We're all worried about one bizarre
black and, uh,
white bitzer zero.
So say there are a
deal be missed, so we'll
have to do the paperwork, um,
now there's a special register
in the CPA which points to the the,
um, the
the first, uh, purchasable
then the perishable,
uh,
the the hardware looks at the
the nine most significant bits in
the address and then uses that as,
uh, an index pointer
into the table.
Then it does the same
with the next level and
with the next level and with the
next level.
Up until the
level where we know
the actual page
and then the 12 bits,
uh, at the end will be
used to point into this page.
So this is a Facebook page,
but, uh, and
so we we can use this page
to do a cytotec,
but what we, uh,
but the situation is that
the other, uh, the page
labels themselves are also page,
uh, pages.
So, uh, yeah, each
each of them are pages.
And so we can also do
a such an attack on these these
pages.
Um, so
let's take a look of what we
can discover this way so we
can find out that
starting page, uh,
uh, gets a hit.
Now, there are eight,
uh, possible entries which
would cause this hit, so we
don't know.
That much, but, uh, uh,
so.
So of all, but if we look at these
pages, we can see that six bits
are the same.
So we can we now
know that there is a sequence of six bits
in this address that has
this value, uh, that
we discovered by doing the timing
side channel.
Now, there are four levels
of pages and there is a final.
Uh.
Location into the pitch.
So we got five
colors, we assume we
know the the last level,
uh, the last, uh,
location inside the pitch because
that's in practice pretty easy to
reverse engineer.
And even if you can't, uh, there
are other channels to find
this out.
In fact, we use this final
location to do this on all
the other locations.
So.
Or actually, we we we try to,
uh, yeah, uh,
try to not get in the
way.
So now
we have found, uh, four
cash lines which may
be used for the walk,
so, uh, we can
we can see that there are four chunks
of three bits that we know nothing about.
And what we also don't know is which
cache line, uh,
which is, uh.
It's used for which level of
purchasable, so that
would give us about
sixteen point six bits of entropy
left. So that's not
a whole lot that we have gained.
We still need to find 16 bits.
However, there is kind of a trick.
So we have a technique called sliding
where we allocate a large enough buffer
and then we just probe
just, uh, uh, one after
another time. So we just at.
Yeah, try the next try the next try the
next page looks a bit like this.
So for the last level cash.
Uh, possible.
We just.
Uh, try the next page, the next page,
the next page, and then when it
switches, we know, OK,
this was a page by a line boundary.
So the next for
the next page, we know that
the lowest bits of this entry are all
zero because it's just
went over the.
Boundry.
Um, this technique we can also
do for the the second
level vegetables.
This time we add two megabytes, two
megabytes, two megabytes, two megabytes.
Still not that, uh,
that's problematic to do from JavaScript.
And then we get the
the whole uh.
Yeah. The whole second level page table
entry.
So how much um
uh
entropy is left so.
Well, we have got two chunks
of free bits and we don't know which
uh.
Uh, vegetable, uh,
uh, which line,
um, belongs to which vegetable,
uh, level, so
we are left with seven bits and this is
so I think.
For this, um,
there's not a lot to do, uh,
about this if we want to have,
uh, good times in JavaScript.
But we can actually do more because in
practice,
stuff doesn't, uh, um,
yeah, you know, in practice
stuff, uh, isn't
optimal. So yeah.
So actually nowadays
we we're starting to be able to allocate
one gigabyte, uh,
uh, locations in JavaScript,
which is probably because you want to
run a real tournament in there or
something.
Um, but then for
the last level, it's, it's kind of too
much, uh, 512 gigabytes
allocations and then you might
have to do that up to a level of
up to eight times.
So maybe not.
However, um, um,
actually, um, uh,
for example, for Firefox on Linux,
um, if you allocate a certain
type of object, um,
colds and Arabo for, um,
Firefox doesn't initialize the memory,
uh, and
it just ask the kernel for the memory and
then just leave it there.
And what the Linux kernel does
is it doesn't initialize it.
And so it doesn't have to map in
pages in the
stable structure. So it just.
Uh, and it doesn't use up
any memory as long as you don't touch
it and we don't have to touch it, we just
have to go over
and touch one page
or a few one page
at the very end.
So, uh,
this seems to, uh.
Yeah.
So actually on Linux, you can it
turns out you can allocate huge chunks
of, uh, virtual memory,
um, and actually,
uh, within uh uh.
Yeah.
Seconds, two minutes, you can,
uh, calculate the whole,
uh, you can you can, uh,
basically do this fighting attack
and flip, uh.
Flip, flip the cash line on the,
uh, the highest
level pitch table
in Chrome, uh, uh,
Chrome does initialize memory, which
is, uh, a bit
unfortunate for us.
But, um, uh,
but what it does is it
defines memory up into an
heap's. And when the heap is full
or decides, OK, maybe for security
reasons, I'll need to create a new
one.
It's just, um.
To increase ASALA,
uh, actually, it's it tries
to allocate the huge, uh,
well, it it tries to leave a huge
gap between the previous EP and the new
hip, which means we can
move forward quickly
in the other space.
So, um, using this
method of creating new hips or,
um, we can, um.
We can, uh, recall for
the third level address
bits, which would leave
us with three bits of entropy left
and on Windows
one or zero.
I am not sure.
Um,
and, uh,
uh, but,
um, so,
um, but doing the attack on the fourth
level would take a lot of
time. And maybe the person uh
uh uh
because, uh, Chrom needs to initialize
and free lots of memory and it just takes
time and your laptop gets hot.
So maybe the user will click away and
uh, no asala for you.
Uh, recovery for you.
So this attack, uh,
was implemented on the Skylake machine,
but, uh, uh, has
been verified that it works, uh,
on the twenty two machines
by, uh, testing
the.
This channel in a on a native sea
with the native sea program.
Uh, so, yeah.
So time, uh,
for demo video.
So.
So here we have,
obviously, the browser.
So these,
uh, these
bits are the wrong measurements.
And what you see here are
signals, uh,
detected by, uh, Soulfire,
which would which kind of try to try
to find the, um,
the the most likely, uh.
The most likely values, uh,
for the attack, so.
Looks really pretty Matrix style.
And then the soldiers
try to get confidence on what
they're measuring up to a certain point,
and then they decide, OK,
it's clear.
And then.
Uh,
touching GDP to verify
the address, we can see
that the address.
Um.
It's a location of memory that
we know.
And because and because
of that, we left a marker
there. So that's,
uh.
So, yeah,
so, uh, in conclusion,
it's possible to to recover
quite a lot of, uh,
information from JavaScript
using hardware side channel alone,
uh, on the memory management unit and,
uh, apparently browser vendors have given
up on this or any
other, uh, uh, such attacks
because you can't have,
uh, you can't
have, um, uh,
multiprocessing with shared memory,
uh, uh,
without this. And apparently, uh,
that's the way the direction we're going.
So, yeah.
Any questions?
As always, please line up at the
microphones, uh, we'll start
with number one, please.
Yes. Uh, have you looked at the actual
browser box and, uh, looked at how many
are exploitable with just a single
pointer?
I mean, usually you need at least two,
you know, code pointer and
some somewhere to to write to actually
gain control of the execution flow.
So in our attack, uh, we,
um, also have, uh, a way to
like a code pointer.
So, um, we first look
at data pointer and then
we create, um, lots
of, uh, JavaScript pages,
uh, get a job, just a JavaScript,
uh, code.
And then we um.
Uh, yeah.
So so linking the
um.
These most significant pages
is really hard to,
uh, to do for code,
but the last level
that so the ones
for the.
Vegetables, which are,
um, you
know, which, uh.
Point to that, the actual pages, and
I think also the levels,
the level one level above
is actually pretty easy.
Well, easy.
It's to do it's doable to
to like using this technique.
Could we get Mike number four, please?
So you just criticized the
browser creators for
the well, not trying
to mitigate all these security issues,
what would you as an
explorer hacker recommend browsers
to watch all the measures they could take
that they have not yet taken?
So, um,
yeah, there's also a
discussion of whether seller,
uh, whether you
want one of the
things that make, uh,
make this attack quite easy is
that, um, a browser makers
have tried to prevent against another
problem called, uh, use of their free
vulnerabilities by allocating
more memory in a different region
every time. Because if you can
free memory and
then, um, I look at, you know, if
I look at something else and then
the bug in the browser will use
it as if it were the old,
uh, uh, old
object, for example, uh, then
you can do usually kind of quite
bad stuff.
So I guess
so. So yeah.
So.
You can think of mitigations against this
technique, but they might work against,
uh, the medications, against
use of the free.
So the question also becomes,
uh, do we,
uh, yeah.
So so is it still worth it?
Um, so, yeah.
Uh, also because, uh,
uh, uh, there are only
seven bits that are not inherent to
the architecture. So, yeah.
The question is.
In an environment where you can run
JavaScript, this is
a seller, uh, yeah,
it might help a bit and sure,
uh, then convert the
spend lots of hours on implementing this.
So an expert,
the writer might, uh.
Yeah.
Uh, yeah, it will still
be extra effort if there is no
easier way, but, um.
Yeah,
yeah.
I'm not sure the.
Could we get a question from the
Internet, please,
given that A is only meant
to help protect against the remote
attacks, how useful is your approach
when an attacker cannot exercise the
MUMU?
So the attacker.
With always exercise, I'm immune, but I
guess, uh, uh,
choosing the location is
harder and, um.
Uh.
And the timing is, of course, over the
network way more difficult, so
I don't really.
Yeah, so but
the thing is that Islam is used
for local attacks and this,
uh, against local attackers.
And this shows that it's, uh,
that are inherently
inside the architecture problems
with this and that it's
not that useful, apparently.
Can we get Mike number one, please?
So, um, recently
I saw a vulnerability about a
security breach on location, which
was for iOS.
And in your presentation, I saw, of
course, the apple cortex, um,
sorry, to Samsung Cortex A7,
which is the iPhone five
processor.
Um, what I'm wondering is
if I create
an error in JavaScript
containing my code, um,
am I able to with
this attack to get the
address of that specific array
or is that impossible?
So,
um.
So, so.
And so I guess she
itself, uh, won't be executable
in any way, but so
you will get a location of memory
that you control completely, if that's
what you, uh.
And that's actually what I meant.
OK, cool.
OK, um, there's therapy you see
available or is this kept
clotheshorse?
And I don't think,
uh, we usually don't release the,
uh, attack, uh,
uh, code.
We do describe,
uh, we have described we described it in
the paper. So, uh,
it's, uh, you know,
uh, it should be reproducible
using the paper.
Thank you.
Yes. And we'll just stay at
Mike one.
I didn't get the graphic you showed us
in JavaScript, what were the colors and
but for you trying to say there and the
Y in X axis, uh,
that's.
Can you stop or
in your video, for example, or
oh, oh, yeah, so,
um,
so I'm not completely
sure, um, about,
uh.
About about the first
one might be role measurements,
the second one, uh,
is are the
the four, I think.
Well, are the page tables
that, uh.
That that we try to, uh,
the the lookups that we try to find.
Yeah, so you
yeah.
And more from my one, please.
Hello. Um, I was just wondering
if you guys actually tested this
technique on public clouds or any
any multitenant architecture.
Uh, so this attack is, uh,
when the browser so,
um, that we tested it as if it
were, uh, a client, a
browser client.
Yeah, I mean, like
I would like to continue, actually, if if
the if it's OK, we have a
lot of time. All right.
So I was actually I
read a couple of things about this.
My question was not really specifically
about the seller, but
more like how how could be like
the mitigation techniques for, like,
public cloud where each tenant has the
right access to the cash line.
And how is that
you think the possible to do to disclose
the decline?
So, yeah, that there have been
quite a few attacks, uh, using
uh uh, yeah.
Using this technique from uh uh,
also just natively
like you would do in uh
in uh uh.
And the environment, for example.
Uh, it's the guy who keeps the
environment. Oh, sorry.
You're on.
So there is a browser plucking
from some researchers at
what's called JavaScript zero,
which aims to provide medication against
such attacks from JavaScript.
Have you heard of it?
And if so, have you
tried if it provides
protection against the attacks you
showed? So I think,
um, yeah.
So I haven't tried it, but, uh,
what I describe I would say, uh,
it would provide protection because,
uh, it it allows you to disable,
um, disable stuff
you don't want, among with which
the shared are a buffer.
Um, so,
so um so so
in principle the buffer wasn't
here before this year anyhow.
And uh
so, so I doubt lots of
public code makes use of it.
Um so, so
I think it's easy to um
to disable stuff you don't want.
There's so javascript they're
basically adding stuff all the time.
Uh, so to make it
suitable for gaming and
uh all kinds of sensors
that you want and uh
so and most code doesn't make use
of it. For example, I, I, I
only use JavaScript on in my browser
when uh the page
doesn't log without.
But um.
Yeah.
Uh so.
I'm all for it, disabling lots
of stuff that we don't need, but,
uh, at the
direction of the browser seems to go the
other direction.
So, uh, I guess
we'll see, uh, how
it will turn out in the end.
Uh.
Do we have any more questions?
No, then, please, I think
I speak again.