Repository navigation
1.2.0: automatic updates and audit fixes - #1
Open
kayurachann wants to merge 4 commits into
Open
kayurachann wants to merge 4 commits into
kayurachann wants to merge 4 commits into
Conversation
Automatic updates: - Every installation checks the GitHub release list about every six hours (ETag, rate limits, backoff retry, preview/stable channels, managed autoUpdate policy) and shows new versions in Settings and the popup. Development builds and the incognito worker do not check. - Optional Windows updater (platform/mv3/updater): a native messaging host installed per user with install-updater.cmd. It verifies the SHA-256 file and, once keys are published, RSA release signatures against pinned, versioned keys (no trust on first use; self-update and key adoption only from signed packages). It refuses unsafe or shared folders, links and unlisted files, backs up, applies with robocopy, restores on failure, repairs interrupted applies, and supports rollback with a hold on the version rolled back from. - The update manager starts with the worker, independently of start(), and waits (bounded) for filtering transactions before replacing the folder or restarting. - Release workflow split into a read-only build job and a publish job that signs, attests build provenance and publishes. Audit fixes: 61 findings from the fork audit and 64 from the review of the auto-update work, each with a regression test. Highlights: startup no longer bricks on an old ruleset journal, cosmetic filtering on a fresh profile, Filter Store pinned downloads and refresh, firewall rule counts, popup-blocker same-site navigation and matcher budget, element tool host binding, worker-side administrator locks, dashboard error reporting, and lazy scriptlet compilation. Tests and tooling: tools/run-tests.mjs runs every tools/test-*.mjs; lint covers every tool and lint:all is clean; a real-Chrome end-to-end test (tools/test-auto-update-chrome.mjs) covers install, permission grant, restart, update and rollback. Docs: new docs/AUTO-UPDATE.md; README (all 10 languages), PRIVACY, THREAT-MODEL, ARCHITECTURE, ROADMAP, FEATURE-MATRIX and CHANGELOG updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Windows PowerShell started from PowerShell 7 (a PowerShell 7 terminal, or a GitHub Actions step) inherits a module path from which Microsoft.PowerShell.Security cannot load, so Get-Acl is missing. The updater then refused every extension folder with "Could not read the permissions", including in the one-step installer. The updater now reads access rules through .NET in Windows PowerShell (Get-Acl only under PowerShell 7) and includes the underlying reason when permissions cannot be read. test-updater-host runs every PowerShell process with such a module path and checks that it hides Get-Acl. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GitHub's Windows runners use an 8.3 TEMP (C:\Users\RUNNER~1\...). The installer registers the ID of the folder's long path, as Chrome derives it from its folder picker, but the test expected the ID of the short path. The fixture now uses its long path, and the first installation passes the folder as TEMP spells it, so the short-to-long mapping stays covered. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Get-Acl was only the first casualty: Windows PowerShell started from PowerShell 7 (a PowerShell 7 terminal, a GitHub Actions step) inherits a module path from which Get-FileHash, Test-Path and other built-in cmdlets cannot load either. The updater and its installer now put $PSHOME\Modules first before running any cmdlet. test-updater-host now puts unloadable Security, Utility and Management modules first on the module path of every PowerShell process, and checks that they hide Get-Acl and Get-FileHash. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Sep 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Version 1.2.0 does two things:
Automatic updates
Update checks. Every installation reads the public GitHub release list about every six hours. A newer version appears in Settings → Updates and in the popup.
api.github.com. It carries no identifiers and no browsing data.autoUpdatepolicy (off/notify/auto).Optional Windows updater (
platform/mv3/updater). The user runsupdater\install-updater.cmdonce and selects Allow the updater, which grants the new optionalnativeMessagingpermission. The extension restarts once and reopens the Updates section. From then on each release installs like this:key(so the extension ID never changes) and a strictly newer version.C:\), and folders holding files that the installed package did not list inupdater/package-files.json.robocopy /MIR /IS /IT /XJ /XD _metadata, verification, and restore on failure. An update interrupted mid-copy is undone automatically on the next run, and the dashboard says so.chrome.runtime.reload(). One-click rollback is available afterwards, and automatic installs then hold the version the user rolled back from.The updater needs no administrator rights, no service and no scheduled task. It runs only when Chrome starts it. Updates wait (up to 60 s) for running filter-list transactions instead of interrupting them.
Release workflow (
.github/workflows/release.yml). Pushing av<version>tag runs two jobs:npm ci --ignore-scripts, tests, lint, both builds and their validators, and version and packaging checks for each ZIP;Design, protocol, trust model and troubleshooting are in
docs/AUTO-UPDATE.md. PRIVACY, THREAT-MODEL, ARCHITECTURE, ROADMAP, CHANGELOG and all 10 READMEs are updated.Audit fixes
Highlights from the first audit (61 findings, 60 fixed, 1 partly):
filteringModelocks are enforced in the worker, not only in the UI.Highlights from the review of the auto-update work (64 findings):
robocopy /MIRcould follow junctions or delete user files in the extension folder. Links, shared folders and unlisted files are now refused, and nothing is changed.start(), so a broken start could block the fix. It now starts with the worker.The full list is in
CHANGELOG.md.Build and tests
npm testnow discovers everytools/test-*.mjsthroughtools/run-tests.mjs, andnpm run lintcovers every tool.npm run lint:allpasses; it previously failed with 136 errors.Testing
npm test: 64/64 test programs pass. New suites:test-auto-updatecovers update policy and orchestration.test-updater-hostdrives the real PowerShell updater against a loopback release server: protocol, hostile packages, lock, stage/apply/rollback, interrupted-apply repair, folder permissions and links, unexpected files, signatures, key generations and rotation, self-update and uninstall.test-release-signingandtest-release-workflowcover the signing tool and the workflow.npm run lintandnpm run lint:allare clean.Standard and Experimental 1.2.0 builds pass
validate-mv3 --release(55 rulesets, 70,314 DNR rules).tools/test-auto-update-chrome.mjsran on real Google Chrome 153 on Windows. It passed 6 times in a row on the final code (twice on the final build):The test harness now clicks Chrome's permission dialog only after Chrome's input protection allows it, and times out instead of hanging on a closed worker session. These runs found defects that unit tests could not catch: the native messaging binding is missing after a runtime permission grant; PowerShell unrolls a one-element
allowed_originsarray into a string; the permission grant raced the restart; and the dashboard focused the Updates heading while the page was still hidden.CI on this PR found one more, which affects users too: Windows PowerShell started from PowerShell 7 (a GitHub Actions step, or a PowerShell 7 terminal running the one-step installer) inherits a module path from which it cannot load its own modules, so
Get-Acl,Get-FileHashandTest-Pathwent missing and the updater refused every folder. The updater and installer now load Windows PowerShell's own modules first, andtest-updater-hostruns every PowerShell process with unloadable copies of those modules first on the path. The test also runs correctly with the 8.3TEMPpath of GitHub runners.After merging
v1.2.0to publish the release through the new workflow.%LOCALAPPDATA%\uBlockPlus\Extension), then runupdater\install-updater.cmd.node tools/release-signing.mjs generate --out <outside the repo>, then commit the public key and set theUBP_RELEASE_SIGNING_KEYsecret.🤖 Generated with Claude Code