Skip to content

fix: block unvetted plugin setup execution#7081

Open
Sourav001254 wants to merge 1 commit into
sugarlabs:masterfrom
Sourav001254:fix-unvetted-plugin-execution
Open

fix: block unvetted plugin setup execution#7081
Sourav001254 wants to merge 1 commit into
sugarlabs:masterfrom
Sourav001254:fix-unvetted-plugin-execution

Conversation

@Sourav001254

@Sourav001254 Sourav001254 commented May 1, 2026

Copy link
Copy Markdown
Contributor

This PR adds a focused security hardening step for plugin loading related to #7046.

Uploaded or otherwise unvetted plugins could still execute setup code through dynamically injected Blob scripts after a confirmation prompt. This change prevents unvetted plugin setup sections from being executed directly in the main application context.

Changes:-

  1. Added a shared isVettedPluginSource() helper for plugin source trust checks.
  2. Blocked unvetted BLOCKPLUGINS, GLOBALS, and ONLOAD setup code from Blob script injection.
  3. Kept vetted built-in/local plugins on the existing direct execution path for compatibility and performance.
  4. Added regression tests to verify uploaded plugin setup code does not create Blob scripts or inject script tags.
  • Security Fix
  • Bug Fix

@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown
Contributor

✅ All Jest tests passed! This PR is ready to merge.

Coverage: Statements: 44.92% | Branches: 36.46% | Functions: 49.99% | Lines: 45.35%

@karthik-dev56

Copy link
Copy Markdown
Contributor

@Sourav001254 add validation check its bug right so - [x] Bug Fix : issue number

@github-actions github-actions Bot added bug fix Fixes a bug or incorrect behavior size/M Medium: 50-249 lines changed area/javascript Changes to JS source files area/tests Changes to test files labels May 2, 2026
@Sourav001254

Copy link
Copy Markdown
Contributor Author

@walterbender @sum2it @omsuneri kindly review this PR

@github-actions

Copy link
Copy Markdown
Contributor

This PR has merge conflicts with master.

Please rebase your branch:

# Add upstream remote (one-time setup)
git remote add upstream https://github.com/sugarlabs/musicblocks.git

# Fetch latest master and rebase
git fetch upstream
git rebase upstream/master

# Resolve any conflicts, then:
git push --force-with-lease origin YOUR_BRANCH

Tip: Enable "Allow edits from maintainers" on this PR so we can auto-rebase for you next time. This only grants access to your PR branch. Your fork's other branches are not affected.

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

This PR has merge conflicts with master.

Please rebase your branch:

# Add upstream remote (one-time setup)
git remote add upstream https://github.com/sugarlabs/musicblocks.git

# Fetch latest master and rebase
git fetch upstream
git rebase upstream/master

# Resolve any conflicts, then:
git push --force-with-lease origin YOUR_BRANCH

Tip: Enable "Allow edits from maintainers" on this PR so we can auto-rebase for you next time. This only grants access to your PR branch. Your fork's other branches are not affected.

@rish106-hub

Copy link
Copy Markdown
Contributor

Heads up — I opened #NNNN which addresses the same gap on current master. Since this branch was cut before the isVettedPlugin refactor landed, #NNNN reuses that existing predicate instead of adding a parallel helper, and applies cleanly without conflicts. Flagging so maintainers can pick whichever fits.

@rish106-hub

Copy link
Copy Markdown
Contributor

Heads up — I opened #7762 which addresses the same gap on current master. Since this branch predates the isVettedPlugin refactor, #7762 reuses that existing predicate instead of adding a parallel helper, and applies without conflicts. Flagging so maintainers can pick whichever fits.

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

Labels

area/javascript Changes to JS source files area/tests Changes to test files bug fix Fixes a bug or incorrect behavior needs-rebase size/M Medium: 50-249 lines changed

Projects

Development

Successfully merging this pull request may close these issues.

4 participants