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

Workbox PWA broken due to integrity hash mismatch #4009

Closed
thexeos opened this issue Oct 29, 2021 · 1 comment
Closed

Workbox PWA broken due to integrity hash mismatch #4009

thexeos opened this issue Oct 29, 2021 · 1 comment

Comments

@thexeos
Copy link

thexeos commented Oct 29, 2021

Issue Details

  • AdGuard version:
    • v3.6.4 (32)
  • Filtering mode:
    • Local VPN
  • Device:
    • Galaxy A5 (2017)
  • Operating system and version:
    • Android 8.0.0
  • Root access:
    • No

Description

When Workbox-based PWAs update (assuming their install was not blocked by any of the filters), the list of files to update may contain integrity attributes, corresponding to SRI hashes. If the hash of the received (server) response does not match the stored hash - the file download, and by extension the update process, fails.

I am seeing these two lines added to the response body for index.html from the PWA's domain (after <meta charset=utf-8> tag):

<script type="text/javascript" nonce="4faaa0101c3b4442b4e06e195dd" src="//local.adguard.org?ts=1635450354873&amp;type=content-script&amp;dmn=domain.com&amp;app=com.android.chrome&amp;css=3&amp;js=1&amp;rel=1&amp;rji=1&amp;sbe=0&amp;stealth=1&amp;uag=&amp;trref=aHR0cHM6Ly9kb21haW4uY29tLw=="></script>
<script type="text/javascript" nonce="4faaa0101c3b4442b4e06e195dd" src="//local.adguard.org?ts=1635450354873&amp;name=AdGuard%20Extra&amp;type=user-script"></script>

Generally, you can tell that the request was made by the Service Worker by inspecting the Referrer header in the request, which would typically look like 'https://domain.com/service-worker.js'.

Either way, this seems to be a recent breaking change, as this specific PWA was able to update through the same mechanism for over a year. From user perspective, this is an issue with the PWA and AdGuard would be the last place they'll look when trying to troubleshoot failed "app" updates.

I can provide the domain name of the PWA, if that would make any difference.

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

No branches or pull requests

3 participants