<s>
WebUSB	B-Language
is	O
a	O
JavaScript	B-Language
application	B-Application
programming	I-Application
interface	I-Application
(	O
API	B-Application
)	O
specification	O
for	O
securely	O
providing	O
access	O
to	O
USB	B-Protocol
devices	O
from	O
web	O
pages	O
.	O
</s>
<s>
As	O
of	O
July	O
2021	O
,	O
it	O
is	O
in	O
Draft	O
Community	O
status	O
,	O
and	O
is	O
supported	O
by	O
Google	B-Application
Chrome	I-Application
,	O
Microsoft	B-Application
Edge	I-Application
,	O
QQ	B-Application
,	O
Opera	B-Application
,	O
and	O
Samsung	B-Application
Internet	I-Application
.	O
</s>
<s>
A	O
Universal	O
Serial	O
Bus	O
,	O
or	O
a	O
USB	B-Protocol
is	O
an	O
industry	O
standard	O
communication	O
protocol	O
used	O
to	O
communicate	O
data	O
across	O
connectors	O
,	O
and	O
cables	O
from	O
computers	O
to	O
peripheral	O
devices	O
and/or	O
other	O
computers	O
.	O
</s>
<s>
WebUSB	B-Language
is	O
a	O
set	O
of	O
API	B-Application
calls	O
that	O
enable	O
access	O
to	O
these	O
hardware	O
devices	O
from	O
web	O
pages	O
.	O
</s>
<s>
WebUSB	B-Language
is	O
developed	O
by	O
the	O
World	O
Wide	O
Web	O
Consortium	O
(	O
W3C	O
)	O
.	O
</s>
<s>
The	O
WebUSB	B-Language
API	B-Application
provides	O
a	O
safe	O
,	O
and	O
developer	O
familiar	O
means	O
of	O
communication	O
to	O
edges	O
devices	O
from	O
web	O
pages	O
.	O
</s>
<s>
The	O
WebUSB	B-Language
API	B-Application
integrates	O
into	O
existing	O
USB	B-Protocol
libraries	O
and	O
shortens	O
the	O
development	O
cycle	O
for	O
integrating	O
new	O
devices	O
into	O
the	O
web	O
environment	O
by	O
not	O
needing	O
to	O
wait	O
for	O
browser	B-Application
support	O
for	O
these	O
devices	O
.	O
</s>
<s>
Early	O
versions	O
of	O
WebUSB	B-Language
came	O
out	O
around	O
as	O
an	O
alternative	O
to	O
Flash	B-Operating_System
,	O
Chrome	B-Application
Serial	O
,	O
and	O
other	O
custom	O
approaches	O
to	O
connecting	O
browsers	B-Application
to	O
hardware	O
.	O
</s>
<s>
WebUSB	B-Language
aims	O
to	O
solve	O
the	O
four	O
goals	O
of	O
any	O
interface	O
being	O
;	O
fast	O
to	O
make	O
,	O
cross	O
platform	O
,	O
look	O
good	O
,	O
accessibility	O
.	O
</s>
<s>
WebUSB	B-Language
API	B-Application
's	O
are	O
able	O
to	O
bridge	O
hardware	O
protocols	O
to	O
internet	O
protocols	O
,	O
enabling	O
the	O
creating	O
of	O
uniform	O
gateways	O
linking	O
edge	O
devices	O
to	O
a	O
centralised	O
networks	O
.	O
</s>
<s>
The	O
WebUSB	B-Language
's	O
API	B-Application
framework	O
standardises	O
disparate	O
protocols	O
and	O
is	O
able	O
to	O
expose	O
non-standard	O
Universal	O
Serial	O
Bus	O
(	O
USB	B-Protocol
)	O
compatible	O
devices	O
to	O
the	O
web	O
.	O
</s>
<s>
The	O
WebUSB	B-Language
looks	O
to	O
sit	O
between	O
the	O
perception	O
layer	O
and	O
the	O
network	O
layer	O
.	O
</s>
<s>
The	O
cloud-based	O
deployment	O
of	O
WebUSB	B-Language
libraries	O
enables	O
it	O
to	O
cover	O
scalability	O
,	O
its	O
low	O
overhead	O
deployment	O
significantly	O
lowers	O
cost	O
,	O
and	O
its	O
continual	O
in	O
use	O
development	O
over	O
its	O
lifetime	O
has	O
enabled	O
the	O
framework	O
to	O
attain	O
a	O
high	O
degree	O
of	O
reliability	O
.	O
</s>
<s>
WebUSB	B-Language
has	O
formed	O
a	O
cornerstone	O
of	O
the	O
BIPES	O
(	O
Block	O
based	O
Integrated	O
Platform	O
for	O
Embedded	O
Systems	O
)	O
architecture	O
framework	O
.	O
</s>
<s>
As	O
already	O
mentioned	O
the	O
role	O
of	O
WebUSB	B-Language
is	O
critically	O
tied	O
to	O
its	O
ability	O
to	O
communicate	O
to	O
embedded	B-Application
software	I-Application
through	O
the	O
USB	B-Protocol
communication	O
protocol	O
.	O
</s>
<s>
Once	O
the	O
information	O
is	O
inside	O
WebUSB	B-Language
's	O
JavaScript	B-Language
environment	O
it	O
can	O
be	O
transposed	O
and	O
communicated	O
through	O
a	O
variety	O
of	O
software	O
protocols	O
.	O
</s>
<s>
In	O
this	O
particular	O
architecture	O
model	O
WebUSB	B-Language
bridges	O
the	O
gap	O
between	O
embedded	B-Application
software	I-Application
,	O
and	O
the	O
web	B-Application
browser	I-Application
.	O
</s>
<s>
The	O
web	B-Application
browser	I-Application
then	O
communicates	O
to	O
the	O
cloud	O
environment	O
using	O
uniform	O
WebUSB	B-Language
constructed	O
data	O
.	O
</s>
<s>
WebUSB	B-Language
provides	O
a	O
web	O
page	O
access	O
to	O
a	O
connector	O
to	O
an	O
edge	O
device	O
.	O
</s>
<s>
By	O
product	O
of	O
design	O
USB	B-Protocol
ports	O
are	O
designed	O
to	O
trust	O
the	O
device	O
they	O
are	O
connected	O
to	O
.	O
</s>
<s>
For	O
instance	O
a	O
malicious	O
host	O
web	O
page	O
could	O
request	O
data	O
from	O
a	O
peripheral	O
device	O
,	O
which	O
the	O
device	O
would	O
happily	O
fulfil	O
thinking	O
it	O
was	O
communicating	O
through	O
a	O
standard	O
USB	B-Protocol
connector	O
.	O
</s>
<s>
To	O
mitigate	O
this	O
type	O
of	O
attack	O
WebUSB	B-Language
developed	O
a	O
requestDevice( )	O
function	O
call	O
.	O
</s>
<s>
This	O
is	O
similar	O
to	O
the	O
access	O
requests	O
browser	B-Application
control	O
for	O
when	O
a	O
web	O
page	O
would	O
like	O
to	O
access	O
the	O
inbuilt	O
camera	O
or	O
microphone	O
.	O
</s>
<s>
Other	O
security	O
considerations	O
included	O
created	O
a	O
public	O
registry	O
of	O
approved	O
connections	O
,	O
but	O
this	O
idea	O
was	O
ultimately	O
scrapped	O
as	O
it	O
required	O
vendors	O
to	O
develop	O
devices	O
with	O
WebUSB	B-Language
in	O
mind	O
.	O
</s>
<s>
The	O
threat	O
surface	O
of	O
a	O
USB	B-Protocol
however	O
is	O
bi-directional	O
and	O
a	O
malicious	O
peripheral	O
device	O
could	O
attack	O
the	O
host	O
.	O
</s>
<s>
An	O
infected	O
edge	O
device	O
cannot	O
easily	O
be	O
mitigated	O
by	O
WebUSB	B-Language
API	B-Application
's	O
.	O
</s>
<s>
In	O
many	O
device	O
configurations	O
trusted	O
USB	B-Protocol
ports	O
are	O
used	O
to	O
deliver	O
firmware	O
upgrades	O
and	O
a	O
malicious	O
edge	O
device	O
could	O
grant	O
attackers	O
persistence	O
in	O
a	O
system	O
.	O
</s>
<s>
In	O
light	O
of	O
the	O
security	O
concerns	O
posed	O
by	O
WebUSB	B-Language
,	O
it	O
is	O
only	O
supported	O
by	O
an	O
estimated	O
76%	O
of	O
browsers	B-Application
.	O
</s>
<s>
Also	O
notably	O
is	O
that	O
support	O
for	O
WebUSB	B-Language
at	O
a	O
browser	B-Application
level	O
has	O
been	O
volatile	O
over	O
time	O
,	O
with	O
stretches	O
of	O
time	O
where	O
certain	O
browsers	B-Application
turned	O
off	O
access	O
after	O
the	O
discovery	O
of	O
particular	O
security	O
threats	O
.	O
</s>
<s>
It	O
is	O
these	O
security	O
concerns	O
that	O
have	O
plagued	O
alternatives	O
to	O
WebUSB	B-Language
.	O
</s>
<s>
Particularly	O
Flash	B-Operating_System
and	O
Google	O
Serial	O
failed	O
to	O
take	O
off	O
because	O
they	O
were	O
unable	O
to	O
be	O
used	O
with	O
adequate	O
answers	O
to	O
these	O
fundamental	O
security	O
risks	O
.	O
</s>
<s>
WebUSB	B-Language
in	O
combination	O
with	O
special	O
purpose	O
devices	O
and	O
public	O
identification	O
registries	O
can	O
be	O
used	O
as	O
key	O
piece	O
in	O
an	O
infrastructure	O
scale	O
solution	O
to	O
digital	O
identity	O
on	O
the	O
internet	O
.	O
</s>
<s>
WebUSB	B-Language
API	B-Application
library	O
is	O
able	O
to	O
standardise	O
the	O
connection	O
of	O
peripheral	O
devices	O
to	O
web	O
pages	O
.	O
</s>
<s>
The	O
security	O
investment	O
in	O
WebUSB	B-Language
makes	O
it	O
a	O
suitable	O
software	O
component	O
in	O
connecting	O
identifiable	O
devices	O
to	O
the	O
internet	O
.	O
</s>
<s>
However	O
,	O
while	O
these	O
are	O
good	O
at	O
identifying	O
an	O
individual	O
,	O
it	O
is	O
only	O
through	O
WebUSB	B-Language
that	O
they	O
can	O
adequately	O
be	O
integrated	O
into	O
the	O
existing	O
internet	O
tech	O
stack	O
.	O
</s>
<s>
Gateway	O
support	O
for	O
such	O
a	O
communication	O
protocol	O
can	O
be	O
supported	O
by	O
software	O
middlemen	O
,	O
such	O
as	O
WebUSB	B-Language
.	O
</s>
<s>
A	O
model	O
system	O
for	O
multi-factor	O
authentication	O
uses	O
WebUSB	B-Language
in	O
tandem	O
with	O
an	O
identifying	O
hardware	O
such	O
as	O
an	O
ID	O
card	O
built	O
to	O
ISO/IEC	O
7810:2003	O
ID-1	O
standards	O
.	O
</s>
<s>
WebUSB	B-Language
would	O
then	O
act	O
as	O
a	O
middle	O
man	O
in	O
facilitating	O
the	O
transfer	O
of	O
data	O
stored	O
on	O
the	O
hardware	O
to	O
a	O
given	O
web	O
server	O
.	O
</s>
<s>
In	O
order	O
to	O
make	O
this	O
digital	O
connection	O
valid	O
,	O
WebUSB	B-Language
would	O
serve	O
as	O
software	O
connector	O
.	O
</s>
<s>
WebUSB	B-Language
will	O
only	O
work	O
on	O
supported	O
browsers	B-Application
,	O
for	O
example	O
Chrome	B-Application
.	O
</s>
<s>
;	O
over	O
HTTPS	B-Protocol
,	O
and	O
can	O
only	O
be	O
called	O
through	O
a	O
user	O
actions	O
.	O
</s>
<s>
For	O
instance	O
in	O
order	O
to	O
instantiate	O
a	O
connection	O
navigator.usb.requestDevice( )	O
can	O
only	O
be	O
called	O
through	O
user	O
gesture	O
,	O
such	O
as	O
touch	O
or	O
mouse	O
click	O
.	O
</s>
<s>
Similarly	O
protection	O
from	O
WebUSB	B-Language
can	O
be	O
provided	O
using	O
a	O
feature	O
policy	O
.	O
</s>
<s>
For	O
instance	O
would	O
prevent	O
WebUSB	B-Language
from	O
running	O
.	O
</s>
<s>
To	O
get	O
access	O
to	O
devices	O
visible	O
to	O
the	O
browser	B-Application
two	O
options	O
are	O
available	O
.	O
</s>
<s>
navigator.usb.requestDevice( )	O
will	O
prompt	O
the	O
user	O
to	O
select	O
which	O
USB	B-Protocol
access	O
is	O
to	O
be	O
given	O
,	O
or	O
navigator.usb.getDevices( )	O
will	O
return	O
a	O
list	O
of	O
USB	B-Protocol
devices	O
that	O
the	O
origin	O
has	O
access	O
to	O
.	O
</s>
<s>
To	O
better	O
search	O
for	O
devices	O
,	O
WebUSB	B-Language
has	O
a	O
number	O
of	O
filtering	O
options	O
.	O
</s>
<s>
These	O
filters	O
are	O
passed	O
into	O
navigator.usb.requestDevice( )	O
as	O
a	O
JavaScript	B-Language
filtering	O
object	O
.	O
</s>
<s>
The	O
USB	B-Protocol
device	O
descriptor	O
returned	O
from	O
the	O
above	O
snippet	O
will	O
contain	O
all	O
important	O
information	O
about	O
the	O
device	O
such	O
as	O
;	O
version	O
,	O
packet	O
size	O
,	O
configuration	O
options	O
etc	O
.	O
</s>
<s>
The	O
alternative	O
call	O
to	O
navigator.usb.getDevices( )	O
will	O
instead	O
look	O
like	O
this	O
;	O
</s>
<s>
Finally	O
the	O
call	O
device.controlTransferOut( )	O
will	O
set	O
up	O
the	O
device	O
to	O
communicate	O
through	O
the	O
WebUSB	B-Language
Serial	O
API	B-Application
.	O
</s>
<s>
In	O
order	O
to	O
generalise	O
interaction	O
with	O
hardware	O
devices	O
WebUSB	B-Language
supports	O
a	O
number	O
of	O
interfaces	O
than	O
abstract	O
away	O
the	O
specific	O
hardware	O
functionality	O
.	O
</s>
<s>
+	O
Interfaces	O
Interface	O
Name	O
Description	O
Provides	O
attributes	O
and	O
methods	O
for	O
finding	O
and	O
connecting	O
USB	B-Protocol
devices	O
from	O
a	O
web	O
page	O
.	O
</s>
<s>
This	O
connection	O
event	O
is	O
passed	O
to	O
USB.onconnect	O
or	O
USB.ondisconnect	O
when	O
the	O
agent	O
detects	O
a	O
change	O
in	O
the	O
connection	O
status	O
.	O
</s>
<s>
Provides	O
information	O
about	O
a	O
particular	O
configuration	O
of	O
a	O
USB	B-Protocol
device	O
.	O
</s>
<s>
Provides	O
information	O
about	O
an	O
interface	O
provided	O
by	O
the	O
USB	B-Protocol
device	O
.	O
</s>
