Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add subresource integrity checking to our user-tracking script #506

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

PeterJCLaw
Copy link
Member

If we're going to track users we should at least ensure that the script which does so is what we're expecting. The value here is derived from a manual check of the current version of the file.

I couldn't find anything on Plausible's website about this, so I'm just guessing that this is ok to do. Ideally it feels like we should pin the version of the library we're pulling in, however I couldn't find anything on how to do that either.

If we're going to track users we should at least ensure that the
script which does so is what we're expecting. The value here is
derived from a manual check of the current version of the file.

I couldn't find anything on Plausible's website about this, so
I'm just guessing that this is ok to do. Ideally it feels like
we should pin the version of the library we're pulling in, however
I couldn't find anything on how to do that either.
Copy link
Member

@RealOrangeOne RealOrangeOne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will silently break functionality if the script is changed upstream (which definitely happens as the Plausible application is deployed).

SRI isn't something officially supported, but there are discussions about it: plausible/analytics#380

@PeterJCLaw
Copy link
Member Author

Hrm, I did suspect that that failure mode might be the case. Really not a fan of their approach that it's too hard to actually version it, especially given that they do already offer an NPM package which itself is already (and must be) versioned!

Perhaps we should pull in the NPM package instead? We could fetch that via https://www.jsdelivr.com/ perhaps or maybe even move towards building the site ourselves (at which point we have more freedom for other things anyway).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants