<s>
Gatekeeper	B-Operating_System
is	O
a	O
security	O
feature	O
of	O
the	O
macOS	B-Application
operating	B-General_Concept
system	I-General_Concept
by	O
Apple	O
.	O
</s>
<s>
Gatekeeper	B-Operating_System
builds	O
upon	O
File	B-Operating_System
Quarantine	I-Operating_System
,	O
which	O
was	O
introduced	O
in	O
Mac	B-Application
OS	I-Application
X	I-Application
Leopard	I-Application
and	O
expanded	O
in	O
Mac	B-Device
OS	I-Device
X	I-Device
Snow	I-Device
Leopard	I-Device
.	O
</s>
<s>
The	O
feature	O
originated	O
in	O
version	O
10.7.3	O
of	O
Mac	B-Application
OS	I-Application
X	I-Application
Lion	I-Application
as	O
the	O
command-line	B-Device
utility	I-Device
.	O
</s>
<s>
A	O
graphical	B-Application
user	I-Application
interface	I-Application
was	O
originally	O
added	O
in	O
OS	B-Operating_System
X	I-Operating_System
Mountain	I-Operating_System
Lion	I-Operating_System
(	O
10.8	B-Operating_System
)	O
but	O
was	O
backported	O
to	O
Lion	B-Application
with	O
the	O
10.7.5	O
update	O
.	O
</s>
<s>
In	O
the	O
security	O
&	O
privacy	O
panel	O
of	O
System	B-Operating_System
Preferences	I-Operating_System
,	O
the	O
user	O
has	O
three	O
options	O
,	O
allowing	O
apps	O
downloaded	O
from	O
:	O
</s>
<s>
The	O
command-line	B-Device
utility	I-Device
provides	O
granular	O
controls	O
,	O
such	O
as	O
custom	O
rules	O
and	O
individual	O
or	O
blanket	O
permissions	O
,	O
as	O
well	O
as	O
an	O
option	O
to	O
turn	O
Gatekeeper	B-Operating_System
off	O
.	O
</s>
<s>
Upon	O
download	O
of	O
an	O
application	O
,	O
a	O
particular	O
extended	B-Application
file	I-Application
attribute	I-Application
(	O
"	O
quarantine	O
flag	O
"	O
)	O
can	O
be	O
added	O
to	O
the	O
downloaded	O
file	O
.	O
</s>
<s>
This	O
attribute	O
is	O
added	O
by	O
the	O
application	O
that	O
downloads	O
the	O
file	O
,	O
such	O
as	O
a	O
web	B-Application
browser	I-Application
or	O
email	B-Protocol
client	I-Protocol
,	O
but	O
is	O
not	O
usually	O
added	O
by	O
common	O
BitTorrent	B-Protocol
client	O
software	O
,	O
such	O
as	O
Transmission	B-Language
,	O
and	O
application	O
developers	O
will	O
need	O
to	O
implement	O
this	O
feature	O
into	O
their	O
applications	O
and	O
is	O
not	O
implemented	O
by	O
the	O
system	O
.	O
</s>
<s>
The	O
system	O
can	O
also	O
force	O
this	O
behavior	O
upon	O
individual	O
applications	O
using	O
a	O
signature-based	O
system	O
named	O
Xprotect	B-Operating_System
.	O
</s>
<s>
Since	O
Snow	B-Device
Leopard	I-Device
,	O
the	O
system	O
keeps	O
two	O
blacklists	O
to	O
identify	O
known	O
malware	O
or	O
insecure	O
software	O
.	O
</s>
<s>
If	O
the	O
application	O
is	O
blacklisted	O
,	O
then	O
File	B-Operating_System
Quarantine	I-Operating_System
will	O
refuse	O
to	O
open	O
it	O
and	O
recommend	O
to	O
the	O
user	O
to	O
move	O
it	O
to	O
trash	B-Application
.	O
</s>
<s>
Gatekeeper	B-Operating_System
will	O
refuse	O
to	O
open	O
the	O
application	O
if	O
the	O
code-signing	O
requirements	O
are	O
not	O
met	O
.	O
</s>
<s>
Once	O
an	O
application	O
has	O
passed	O
File	B-Operating_System
Quarantine	I-Operating_System
or	O
Gatekeeper	B-Operating_System
,	O
it	O
will	O
be	O
allowed	O
to	O
run	O
normally	O
and	O
will	O
not	O
be	O
verified	O
again	O
.	O
</s>
<s>
To	O
override	O
Gatekeeper	B-Operating_System
,	O
the	O
user	O
(	O
acting	O
as	O
an	O
administrator	O
)	O
either	O
has	O
to	O
switch	O
to	O
a	O
more	O
lenient	O
policy	O
from	O
the	O
security	O
&	O
privacy	O
panel	O
of	O
System	B-Operating_System
Preferences	I-Operating_System
or	O
authorize	O
a	O
manual	O
override	O
for	O
a	O
particular	O
application	O
,	O
either	O
by	O
opening	O
the	O
application	O
from	O
the	O
context	O
menu	O
or	O
by	O
adding	O
it	O
with	O
.	O
</s>
<s>
Developers	O
can	O
sign	O
disk	B-Application
images	I-Application
that	O
can	O
be	O
verified	O
as	O
a	O
unit	O
by	O
the	O
system	O
.	O
</s>
<s>
In	O
macOS	B-Operating_System
Sierra	I-Operating_System
,	O
this	O
allows	O
developers	O
to	O
guarantee	O
the	O
integrity	O
of	O
all	O
bundled	O
files	O
and	O
prevent	O
attackers	O
from	O
infecting	O
and	O
subsequently	O
redistributing	O
them	O
.	O
</s>
<s>
In	O
addition	O
,	O
"	O
path	O
randomization	O
"	O
executes	O
application	B-Application
bundles	I-Application
from	O
a	O
random	O
,	O
hidden	O
path	O
and	O
prevents	O
them	O
from	O
accessing	O
external	O
files	O
relative	O
to	O
their	O
location	O
.	O
</s>
<s>
This	O
feature	O
is	O
turned	O
off	O
if	O
the	O
application	O
bundle	B-Application
originated	O
from	O
a	O
signed	O
installer	B-Operating_System
package	I-Operating_System
or	O
disk	B-Application
image	I-Application
or	O
if	O
the	O
user	O
manually	O
moved	O
the	O
application	O
without	O
any	O
other	O
files	O
to	O
another	O
directory	O
.	O
</s>
<s>
The	O
effectiveness	O
and	O
rationale	O
of	O
Gatekeeper	B-Operating_System
in	O
combating	O
malware	O
have	O
been	O
acknowledged	O
,	O
but	O
been	O
met	O
with	O
reservations	O
.	O
</s>
<s>
Security	O
researcher	O
Chris	O
Miller	O
noted	O
that	O
Gatekeeper	B-Operating_System
will	O
verify	O
the	O
developer	O
certificate	O
and	O
consult	O
the	O
known-malware	O
list	O
only	O
when	O
the	O
application	O
is	O
first	O
opened	O
.	O
</s>
<s>
Malware	O
that	O
already	O
passed	O
Gatekeeper	B-Operating_System
will	O
not	O
be	O
stopped	O
.	O
</s>
<s>
In	O
addition	O
,	O
Gatekeeper	B-Operating_System
will	O
only	O
verify	O
applications	O
that	O
have	O
the	O
quarantine	O
flag	O
.	O
</s>
<s>
As	O
this	O
flag	O
is	O
added	O
by	O
other	O
applications	O
and	O
not	O
by	O
the	O
system	O
,	O
any	O
neglect	O
or	O
failure	O
to	O
do	O
so	O
does	O
not	O
trigger	O
Gatekeeper	B-Operating_System
.	O
</s>
<s>
According	O
to	O
security	O
blogger	O
Thomas	O
Reed	O
,	O
BitTorrent	B-Protocol
clients	I-Protocol
are	O
frequent	O
offenders	O
of	O
this	O
.	O
</s>
<s>
The	O
flag	O
is	O
also	O
not	O
added	O
if	O
the	O
application	O
came	O
from	O
a	O
different	O
source	O
,	O
like	O
network	B-General_Concept
shares	I-General_Concept
and	O
USB	O
flash	O
drives	O
.	O
</s>
<s>
In	O
September	O
2015	O
,	O
security	O
researcher	O
Patrick	O
Wardle	O
wrote	O
about	O
another	O
shortcoming	O
that	O
concerns	O
applications	O
that	O
are	O
distributed	O
with	O
external	O
files	O
,	O
such	O
as	O
libraries	B-Library
or	O
even	O
HTML	B-Language
files	I-Language
that	O
can	O
contain	O
JavaScript	B-Language
.	O
</s>
<s>
The	O
application	O
and	O
its	O
external	O
files	O
can	O
then	O
be	O
redistributed	O
,	O
while	O
leaving	O
the	O
original	O
signature	O
of	O
the	O
application	O
bundle	B-Application
itself	O
intact	O
.	O
</s>
<s>
As	O
Gatekeeper	B-Operating_System
does	O
not	O
verify	O
such	O
individual	O
files	O
,	O
the	O
security	O
can	O
be	O
compromised	O
.	O
</s>
<s>
With	O
path	O
randomization	O
and	O
signed	O
disk	B-Application
images	I-Application
,	O
Apple	O
provided	O
mechanisms	O
to	O
mitigate	O
this	O
issue	O
in	O
macOS	B-Operating_System
Sierra	I-Operating_System
.	O
</s>
<s>
In	O
2021	O
,	O
a	O
vulnerability	O
was	O
discovered	O
where	O
putting	O
#	B-Operating_System
!	I-Operating_System
</s>
<s>
on	O
the	O
first	O
line	O
(	O
without	O
the	O
path	O
of	O
the	O
interpreter	B-Application
)	O
of	O
a	O
file	O
bypassed	O
Gatekeeper	B-Operating_System
.	O
</s>
<s>
In	O
2022	O
,	O
a	O
Microsoft	O
researcher	O
shared	O
a	O
vulnerability	O
that	O
abuses	O
the	O
AppleDouble	B-Application
format	I-Application
to	O
set	O
an	O
arbitrary	O
Access-control	O
list	O
to	O
bypass	O
Gatekeeper	B-Operating_System
.	O
</s>
