  Modern web applications often rely on third-party services to provide their
functionality to users. The secure integration of these services is a
non-trivial task, as shown by the large number of attacks against Single Sign
On and Cashier-as-a-Service protocols. In this paper we present Bulwark, a new
automatic tool which generates formally verified security monitors from applied
pi-calculus specifications of web protocols. The security monitors generated by
Bulwark offer holistic protection, since they can be readily deployed both at
the client side and at the server side, thus ensuring full visibility of the
attack surface against web protocols. We evaluate the effectiveness of Bulwark
by testing it against a pool of vulnerable web applications that use the OAuth
2.0 protocol or integrate the PayPal payment system.
