Repository navigation
Refresh built-in plugin hashes when loading trusted-plugins.json (#733) - #738
Merged
Merged
Conversation
trusted-plugins.json snapshotted the built-in hash table on first run and was never refreshed, so after an upgrade every built-in plugin failed hash verification. On load, the running build's built-in names and hashes now overwrite stale entries; user-trusted entries and settings are kept, and the file is saved back when anything changed. Tampered built-in DLLs are still rejected.
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.
Fixes #733
Summary
trusted-plugins.jsonstored the built-in hash table from the first run and never updated it. After an upgrade, every built-in plugin failed hash verification, so only the columnizers insideLogExpert.Corewere available.LoadTrustedPluginConfiguration file exists deserialize if null → defaults + save + else if RefreshBuiltInPlugins(config) # running build's GetBuiltInPluginHashes() is authoritative + saveUser-trusted entries and
AllowUserTrustedPluginsare not touched. The troubleshooting section ofPLUGIN_HASH_MANAGEMENT.mddescribed the old behaviour and has been updated.Evidence
New tests in
PluginValidatorConfigPersistenceTests. Hash verification is forced on and the config folder is a temp folder:Initialize_WithStaleBuiltInHash_ValidatesBuiltInPluginfailed with "Expected hash: 00000000…".…PersistsRunningBuildHashesAndKeepsUserEntriesfailed because the stale hash was kept andJsonColumnizer.dllwas missing fromPluginNames.After: both pass. The saved file holds the running build's hashes, and the user entry and the setting are unchanged.
ValidatePlugin_TamperedBuiltInPlugin_IsRejectedWithHashMismatchpasses before and after. A copy ofCsvColumnizer.dllwith one byte appended is still rejected with "has been modified".Merge Danger
Door: two-way
On first launch the file is rewritten with the current build's hashes. Rolling back the code just brings back the old behaviour. Nothing is deleted, and user-trusted entries survive.
Blast Radius: plugin loading
Every built-in plugin goes through this path in Release builds. If the generated hash table were wrong, the built-in plugins would be rejected. They already are today after an upgrade, but this change would also affect fresh installs. Debug builds skip hash verification, so CI's Release test run is the first real check.