"cmd/principal": No third-party code on Macaroon receiving page

A bugcrowd researcher recently reported an attack wherein an
attacker can steal macaroons by carrying out a MITM attack on
the CSS fetching done by our macaroon-receiver page.

See: https://github.com/veyron/release-issues/issues/2033

The macaroon-receiver page runs on http://localhost and the CSS
is fetched over HTTP as well. As a result using a MITM attack on
the CSS fetching, an attacker can get hold of the URL of the page
via the referrer header and therefore the macaroon embedded in the
URL. The macaroon can then be used by the attacker to obtain a
blessing for himself under the identity encapsulated in the
macaroon, thus carrying out an impersonation attack.

While there are a number of ways to fix this attack -- fetching
the CSS over HTTPS, or, redirecting the macaroon-receiver page to one
that does not have the macaroon embedded in the URL, or getting
rid of the CSS entirely.

This CL goes with the third fix mentioned above. The macaroon-receiver
page is one of the most security-critical pages in our seek-blessings
flow. Therefore, it is risky to have *any* third-party code on this
page. By not having any third-party code, and not making any external
requests, we eliminate the risk of leaking any data out from the
macaroon-receiver page.

This CL gets rid of the link to the stylesheet, and instead inlines some
style attributes on the various HTML tags.

Change-Id: I4dc1429b194de79b761020ccf38242eafb95bd18
1 file changed
tree: 1c543045950ad54a5ba3ca4ea1289b2496dc2b98
  1. cmd/
  2. envvar/
  3. examples/
  4. internal/
  5. lib/
  6. profiles/
  7. services/
  8. test/
  9. .gitignore
  10. AUTHORS
  11. CONTRIBUTORS
  12. LICENSE
  13. PATENTS
  14. README.md
  15. VERSION
README.md

Vanadium

This repository contains a reference implementation of the Vanadium APIs.

Unlike the APIs in https://github.com/vanadium/go.v23, which promises to provide backward compatibility this repository makes no such promises.