Skip to content

Feature/plugins poc 4 - #9122

Draft
henryjonathanquispe wants to merge 17 commits into
developfrom
feature/plugins-poc-4
Draft

henryjonathanquispe wants to merge 17 commits into
developfrom
feature/plugins-poc-4

Conversation

@henryjonathanquispe

@henryjonathanquispe henryjonathanquispe commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Related Tickets & Packages

Code Review Checklist

  • I have pulled this code locally and tested it on my instance, along with any associated packages.
  • This code adheres to ProcessMaker Coding Guidelines.
  • This code includes a unit test or an E2E test that tests its functionality, or is covered by an existing test.
  • This solution fixes the bug reported in the original ticket.
  • This solution does not alter the expected output of a component in a way that would break existing Processes.
  • This solution does not implement any breaking changes that would invalidate documentation or cause existing Processes to fail.
  • This solution has been tested with enterprise packages that rely on its functionality and does not introduce bugs in those packages.
  • This code does not duplicate functionality that already exists in the framework or in ProcessMaker.
  • This ticket conforms to the PRD associated with this part of ProcessMaker.

ci:deploy

julceslauhub and others added 17 commits July 31, 2026 16:54
commit b84543b
Author: AugustoLopezProcess <augusto.lopez+github@processmaker.com>
Date:   Tue Apr 21 08:27:15 2026 -0400

    Adding plugin admin ui

commit ca8a863
Author: Nolan Ehrstrom <github@nolanpro.com>
Date:   Mon Mar 9 11:01:46 2026 -0700

    Add controllers and routes for plugin UI

    Copied from feature/plugins-poc-vite-ui (just without the vite/Vue3 integration)

commit 3cc89bc
Merge: 9e9b4aa 5da27ce
Author: Nolan Ehrstrom <github@nolanpro.com>
Date:   Mon Mar 9 10:58:27 2026 -0700

    Merge branch 'task/FOUR-28803' into feature/plugins-poc

commit 9e9b4aa
Author: Nolan Ehrstrom <github@nolanpro.com>
Date:   Mon Jan 19 12:30:54 2026 -0800

    Add install command and cached routes

commit 4a5df14
Author: Nolan Ehrstrom <github@nolanpro.com>
Date:   Wed Dec 10 09:29:20 2025 -0800

    Start on plugins
Updating feature/plugins-poc-4 with last changes in develop
FOUR-32722 Some adjustments in plugins installation
FOUR-32760 After install/enable/disable a plugin, should be executed the command: php artisan horizon:terminate
…ink, add load screen-builder-form.js files from plugin
…ink, add load screen-builder-form.js files from plugin
…ink, add load screen-builder-form.js files from plugin
…ink, add load screen-builder-form.js files from plugin
@cursor

cursor Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

PR Summary

High Risk
Plugin install loads arbitrary code from URLs/zips, runs shell/git/composer/supervisor, and mutates tenant routes and workers—high operational and security impact for admin-facing features.

Overview
Adds a plugin lifecycle for tenant storage/plugins: install from Git URL, local path, or zip; uninstall; enable/disable via _ folder rename; and git-based reinstall. Work runs on queued jobs with WithoutOverlapping, while HTTP/API returns immediately. PluginManager validates composer.json (PSR-4 under ProcessMaker plugin/package namespaces), runs composer install and optional {name}:install / :uninstall artisan hooks, rebuilds tenant route cache (with TENANT in subprocess env), and optionally supervisorctl restart. Progress is pushed via PluginLog broadcasts on the requesting user’s private channel; the admin PluginOutput Vue component listens with Echo.

Admin surface: manage-plugins permission, web Plugins screen and API routes, console plugin:install|list|uninstall, admin menu entry, and PluginServiceProvider loading enabled plugins after TenantResolved. ScreenBuilderManager also loads screen-builder extension JS from published plugin assets under public/vendor/processmaker/packages/.

Multitenancy / runtime: SwitchTenant sets per-tenant APP_ROUTES_CACHE, extends tenant-aware broadcasting, and reloads cached routes for Octane/console/tests. Setting::readyToUseSettingsDatabase now uses an app-container flag instead of a static.

Separately introduces the cross-project manage-requirements agent skill: JSON schemas, validate-requirements.js / check:requirements (schema + Python heuristic QC), templates, and ai-docs/processmaker/requirements catalogs for plugin-manager and admin-plugins.

Reviewed by Cursor Bugbot for commit 1a97475. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 5 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1a97475. Configure here.

} else {
$this->logRunning("Plugin {$command} command output:\n\n{$result->output()}", $pluginName, $userId);
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Install command stderr treated as failure

High Severity

runCommand never throws and looks for is not defined only on stdout. Artisan writes that message to stderr, so a missing {plugin}:install or {plugin}:uninstall command is logged as error. PluginOutput then marks the job failed and ignores the later done event, even though composer install and copy already succeeded.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1a97475. Configure here.

$this->runCommand($uninstallCommand, $pluginName, $userId);

$this->logRunning('Removing plugin directory...', $pluginName, $userId);
$this->removePluginPath($pluginPath, $pluginName, $userId);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plugin name allows storage path traversal

High Severity

Uninstall, toggle, and reinstall interpolate the unsanitized {name} route parameter into storage/plugins/{name}. A name of .. resolves to the tenant storage directory, so uninstall recursively deletes it. Toggle would rename that same directory.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1a97475. Configure here.


try {
$zip->extractTo($tmpExtractDir);
$zip->close();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zip extract allows path traversal

High Severity

installFromZip calls ZipArchive::extractTo on the uploaded archive with no entry-name sanitization. Entries such as ../ can write outside the temp directory before validatePlugin runs, including overwriting application files.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1a97475. Configure here.

}

return $composerJson;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bad plugin JSON crashes tenant boot

Medium Severity

loadPlugins throws on invalid composer.json or a missing PSR-4 directory. That exception escapes the TenantResolved listener, so one corrupt plugin prevents the tenant from booting and serving requests.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1a97475. Configure here.

public function broadcastOn()
{
return new PrivateChannel('ProcessMaker.Models.User.' . $this->userId);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Null user PluginLog still broadcasts

Medium Severity

PluginLog always implements ShouldBroadcastNow and builds ProcessMaker.Models.User.{userId} even when userId is null. CLI install/uninstall failure events fire without a user, so the worker broadcasts to ProcessMaker.Models.User. and can throw or hit an invalid private channel.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1a97475. Configure here.

@henryjonathanquispe henryjonathanquispe changed the title Feature/plugins poc 4 Feature/plugins poc 4 Nov 6, 2026
@decisions-sonarqube

Copy link
Copy Markdown

@pmPaulis
pmPaulis marked this pull request as draft November 12, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants