fix: block unvetted plugin setup code from executing in main realm#7762
Open
rish106-hub wants to merge 1 commit into
Open
fix: block unvetted plugin setup code from executing in main realm#7762rish106-hub wants to merge 1 commit into
rish106-hub wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7762 +/- ##
==========================================
+ Coverage 54.60% 54.70% +0.10%
==========================================
Files 172 172
Lines 57270 57273 +3
==========================================
+ Hits 31272 31332 +60
+ Misses 25998 25941 -57 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Jul 8, 2026
Open
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.
Description
processPluginData(js/utils/utils.js) applies theisVettedPlugin()trust gate to 5 of 8 plugin handler types (FLOW/ARG/PARAMETER/ONSTART/ONSTOP), but not to the three setup types —BLOCKPLUGINS,GLOBALS,ONLOAD. Those route through the localsafeEval()closure, which checks onlyuserConfirmed, then executes the code via a Blob<script>in the main realm with fullactivity/windowaccess.Result: an unvetted plugin that clears the
confirm()dialog runs arbitrary JavaScript with full privileges through those three keys — bypassing the exact-match whitelist inLogo.safePluginExecute()that already protects the other handler types. This is the core privilege-escalation concern in #7046, and it presents as an inconsistency: one trust predicate applied everywhere except these three handlers.Related Issue
Partially addresses #7046
PR Category
Changes Made
js/utils/utils.js: added theisVettedPlugin(pluginSource)check to thesafeEvalclosure. UnvettedBLOCKPLUGINS/GLOBALS/ONLOADsetup code is now refused (logged) instead of executed in the main realm. Vetted sources (built-in `plugins/`, `./plugins/`, `localStorage:plugins`) keep their existing execution path. Reuses the existing predicate — no new helper.Testing Performed
Checklist
Additional Notes for Reviewers
Scoped intentionally narrow: this closes the immediate main-realm code-execution path for unvetted plugins as a single-file change, rather than the full iframe-sandbox/CSP overhaul in #7046's acceptance criteria (which remains valuable as follow-up work). It supersedes #7081's approach on current master by reusing the existing `isVettedPlugin` predicate uniformly instead of adding a parallel helper.
Tradeoff: unvetted plugins become partially inert (palette/blocks register; setup JS blocked) until a sandbox lands. Fail-closed is the safe default for an educational tool and matches the existing whitelist behavior in `Logo.safePluginExecute()`.