Every plugin or extension a SaaS product accepts is third-party code running inside your trust boundary, and most extension platforms were designed for reach first and containment second. Marketplace apps for WordPress, Jira and Confluence, Jenkins, IDEs and browsers keep turning up in incident reports, usually because the host gave the extension far more access than its job needed, or because the extension held long-lived tokens for many tenants at once. This guide is for engineers and architects who build an extension model into their own product, and for security teams who review one. It compares the isolation models in use today, shows how to design permissions, egress and token handling, and sets out the marketplace review, monitoring and kill switch controls that make a plugin ecosystem survivable.
Key takeaways
- Isolation is the architecture decision that matters most. In-process plugins (WordPress, Jenkins, VS Code) inherit everything the host can do; out-of-process or sandboxed models (Atlassian Forge, browser Manifest V3, WebAssembly) can be constrained by the platform.
- Declare, review and enforce permissions in a manifest. Scopes, egress domains and content policies should be machine-readable, shown to the installing admin and re-approved whenever a new version asks for more.
- Never let extensions hold raw platform credentials if you can avoid it. Broker tokens through the platform so the extension calls APIs without ever seeing the token, as Forge does with its managed APIs and
withProvider. - Every authorisation check belongs to the extension and the host. Hiding a button is not access control; every endpoint an extension exposes needs a server-side permission check, as the Gravity SMTP case showed.
- Plan for the malicious or compromised extension. Signed packages, behaviour scanning, a block list, remote disable and per-extension audit logs turn a marketplace compromise into a contained event rather than a mass breach.
Why extension ecosystems fail
An extension model creates three new parties inside your product: the extension author, the marketplace that distributes code, and the installing administrator who decides what to trust. Each can fail independently. The common thread in public incidents is not exotic exploitation; it is excess authority. An extension that can read every file, call every API and reach any domain only needs one bug, one malicious update or one stolen publisher account to become a breach.
- Vulnerable extension code: missing authorisation on routes the extension registers, injection, cross-site scripting in rendered settings pages. Plugins remain the main weak point of WordPress estates; see the PHP and WordPress Security Guide.
- Malicious extension published to a marketplace: code that works as advertised but exfiltrates secrets. Reviews that check API compatibility rather than data flows miss this.
- Compromised publisher or build pipeline: a legitimate extension ships a hostile update to its whole install base through auto-update (MITRE ATT&CK T1195.002 Compromise Software Supply Chain).
- Persistence through extensions: attackers install or modify extensions to keep access (ATT&CK T1176 Software Extensions, with sub-techniques T1176.001 Browser Extensions and T1176.002 IDE Extensions).
- Concentrated tokens: an integration vendor that stores OAuth tokens for hundreds of tenants becomes a single point of failure (ATT&CK T1528 Steal Application Access Token).
Isolation models compared
The first design choice is where extension code executes and what it shares with the host. The table compares the models used by widely deployed platforms, drawn from each platform's own documentation.
| Model | Example platforms | What the extension can reach | Containment strength | Main trade-off |
|---|---|---|---|---|
| In-process, same language runtime | WordPress plugins (PHP), Jenkins plugins (JVM) | Everything the host process can: database, file system, configuration, other plugins' data | Weak: relies on author discipline and review | Maximum flexibility; one bug or bad update compromises the host |
| Separate host process, same privileges | VS Code extension host | Microsoft states extensions have the same permissions as VS Code: files, network, external processes, settings | Weak for data, stronger for stability | Protects the UI from crashes, not the user from the extension |
| Platform-hosted serverless sandbox | Atlassian Forge | Only scoped product APIs and declared egress domains, through an outbound proxy | Strong: isolated execution per app, separate cloud accounts from core services | Less freedom for developers; platform must run the code |
| Browser extension with declared permissions | Chrome Manifest V3 | Declared host permissions and APIs; remote code banned in extension pages | Medium to strong, depends on requested hosts | Broad host permissions (all sites) cancel much of the benefit |
| Capability-based WebAssembly runtime | Wasm plugin hosts using WASI | Only the handles (files, sockets) the host passes in | Strong by design | Ecosystem and language support still maturing; see the WebAssembly Security Guide |
| Remote app over webhooks and OAuth | Marketplace apps calling your public API | Whatever the granted OAuth scopes allow | Depends entirely on scope design and token handling | No code runs in your estate, but tokens live in the vendor's |
Decision guidance: if you are designing a new extension model, prefer a platform-hosted sandbox or a capability-based runtime and expose your product to it through a narrow API, rather than loading third-party code into your main process. If you must support in-process plugins for compatibility, treat the plugin layer as untrusted, put the host behind its own least privilege boundary (separate database user, file system permissions, no cloud credentials in the process) and invest more in review and runtime monitoring. Small teams usually cannot run a review programme that matches the risk of in-process code, which is a strong argument for the sandboxed route from the start. The principle behind all of this is capability-based security: give code the specific authority it needs and nothing ambient.
Designing the permission and manifest model
A manifest is the contract between extension, platform and administrator. It should be the only place permissions come from, and the platform should enforce it at runtime, not just display it at install time.
What the manifest should declare
- API scopes: named, granular scopes per resource and action (read versus write, per object type). Forge apps request OAuth 2.0 scopes in the manifest and cannot reach protected resources without them, and the Forge permissions reference tells developers to use the minimum set of scopes required.
- Egress destinations: the exact domains backend code and client code may contact. Forge separates
external.fetch.backend(functions) fromexternal.fetch.client(the browserconnect-src), and notes that a wildcard such as*.example.comdoes not include the parent domain. All backend traffic passes an outbound proxy that enforces these declarations. - Content security policy relaxations: any request for
unsafe-inline,unsafe-evalor similar should be an explicit, reviewable manifest entry (Forge usescontent.scriptsandcontent.styles), not a default. - User impersonation: whether the extension may act as the user, and whether it may do so offline. Forge expresses offline impersonation per scope with
allowImpersonationand limits it to active users in the installation context. - Remote code policy: Chrome Manifest V3 requires that all extension logic is part of the package and blocks
eval()andnew Function()in extension pages; itscontent_security_policy.extension_pageskey only accepts'self','none'and'wasm-unsafe-eval'for script sources. A rule like this makes review meaningful, because the code reviewed is the code that runs.
Re-approval on permission growth
Auto-update is where trust decisions silently expire. Atlassian requires administrators to reapprove any new Forge app version that increases scopes, permissions or egress domains. Build the same rule into your own platform: compute a permission diff between versions, block the upgrade until an administrator approves it, and keep the old version running in the meantime. Consider a cooling-off period or staged rollout for updates from publishers whose account or signing key changed recently.
Credentials, tokens and tenant isolation
Extensions are non-human identities. Each installation needs its own identity, its own credentials and its own audit trail, not a shared integration key.
| Pattern | How it works | Risk if done badly | Recommended practice |
|---|---|---|---|
| Platform-brokered API calls | Platform attaches credentials to the extension's API calls; extension never sees the token | Low; compromise is limited to the scopes and the running session | Default choice. Forge's managed APIs and withProvider for external OAuth providers work this way |
| Per-installation OAuth client | Each tenant install gets its own client or refresh token | Vendor stores many tenants' tokens; breach of the vendor exposes all | Short-lived access tokens, encrypted refresh tokens, per-tenant keys, sender-constrained tokens where supported |
| Static API key pasted into settings | Admin or user copies a key into the extension's configuration page | Keys leak through settings exports, debug endpoints, logs and malicious extensions | Avoid. If unavoidable, store in a secrets service, never return it to the browser, scope and cap it |
| Shared vendor-wide credential | One credential used for every customer | Total cross-tenant exposure | Do not use |
- Tenant data isolation: Atlassian describes tenant isolation as a shared responsibility. The platform prevents one tenant calling another's app, but the developer must make sure in-memory caches and stored data never cross tenants. Key every cache and storage record by installation identifier and test for it.
- Debug and diagnostic endpoints: system reports, health checks and "test connection" routes routinely contain secrets. The Gravity SMTP CVE-2026-4020 case exposed email provider API keys, OAuth tokens and SMTP passwords because a REST route's permission callback always returned true.
- Token concentration: the Salesloft Drift breach showed what happens when one integration vendor's environment holds OAuth tokens for hundreds of customers. If you are that vendor, segment token storage, encrypt per tenant and alert on bulk token use. If you are the customer, see the Gong, Drift and Sales Engagement OAuth Integration Security Guide.
For managing these credentials across their life cycle, see the API Key Management Guide.
Secure coding rules for extension authors
Platform owners should publish these rules, check them in review and, where possible, enforce them through the SDK.
- Server-side authorisation on every handler: Jenkins guidance says to call
checkPermissionbefore any security-sensitive operation, including form validation (doCheck) and autocomplete (doAutoComplete) methods, and warns that hiding UI elements withh.hasPermissionis cosmetic because users can still reach URLs directly. A page-level permission in Jelly blocks viewing, not form submission. In WordPress, each REST route needs a realpermission_callbackand admin actions need a capability check such ascurrent_user_can(). - Request forgery protection: state-changing actions must require POST and a per-request token (WordPress nonces, Jenkins crumbs).
- Input and output handling: the WordPress security handbook sets the principles as never trust user input, escape as late as possible, escape everything from untrusted sources including the database and third parties, and prefer validation or rejection over sanitisation. Use parameterised queries such as
$wpdb->prepare(). - Account status: Jenkins notes that authentication plugins which can detect locked, disabled or expired accounts should throw an
AccountStatusExceptionsubtype, otherwise API tokens and SSH keys may keep working after an account is disabled. - Secrets at rest: use the platform's secret storage (Jenkins provides dedicated guidance on storing secrets) and never write tokens to logs or exportable settings.
- No dynamic code loading: no fetching scripts at runtime, no
eval, no downloading binaries after install.
For language-level detail, see the Jenkins Security Guide and the Browser Extension Security Guide.
Marketplace governance and review
A curated marketplace is a security control only if review looks at behaviour, not just compatibility. JetBrains acknowledged after the JetBrains Marketplace AI plugin campaign that its verifier checked compatibility and API usage rather than data flows; 15 working AI assistant plugins forwarded users' API keys to an external server.
| Control | What it catches | Example in a live marketplace |
|---|---|---|
| Publisher verification | Impersonation and throwaway accounts | VS Code Marketplace verified publishers prove domain ownership and six months in good standing |
| Publisher trust prompt | Unreviewed installs from unknown publishers | VS Code 1.97 and later asks users to confirm trust in third-party publishers |
| Multi-engine malware and sandbox behaviour scan | Known malware, obvious exfiltration at runtime | VS Code Marketplace scans each package and update and runs it in a sandboxed VM |
| Secret scanning on publish | Authors shipping their own credentials | VS Code Marketplace blocks publication when secrets are found |
| Name squatting protection | Look-alike official publishers | VS Code Marketplace blocks squatting on official publisher names |
| Package signing and install-time verification | Tampering between marketplace and client | VS Code checks the Marketplace signature at install |
| Block list and remote uninstall | Extensions confirmed malicious after release | VS Code automatically uninstalls block-listed extensions |
| Data flow review of credential fields | Working tools that quietly exfiltrate keys | The gap identified in the JetBrains case |
Two further controls are cheap and effective: require multi-factor authentication and hardware-backed signing keys for publisher accounts, and flag any update that adds egress domains, adds permissions or changes ownership for manual review. Platform engineers should also offer customers an allow list policy; VS Code supports administrator-enforced allowed extensions, documented in its enterprise extension settings.
Detection, monitoring and the kill switch
Assume one extension will go bad. The platform needs to see it and stop it quickly across every tenant.
- Log per extension identity: every API call, scope used, egress destination and data volume, attributed to extension, version and installation, and available to the customer.
- Baseline and alert: alert on new egress domains, sudden bulk reads, calls outside the declared scopes (which should already fail) and access at unusual hours for that installation.
- Build a remote disable: one action that suspends an extension version or publisher across all tenants, revokes its tokens and blocks egress, with a runbook and an owner on call.
- Notify and rotate: customers need to know which installations ran the bad version, and which credentials it could read. Patching does not revoke secrets already read, so rotation must be part of the response.
- Test it: run an exercise at least yearly in which a test extension is declared malicious and the team measures time to disable.
Metrics that show the programme is working:
- Scope minimality: share of listed extensions requesting write or admin scopes, tracked down over time.
- Egress breadth: share of extensions with wildcard or unrestricted egress.
- Time to disable: minutes from confirmed malicious report to the extension stopped in all tenants.
- Re-approval coverage: percentage of permission-increasing updates that were held for admin approval (target 100%).
- Brokered credential share: share of installations using platform-brokered tokens rather than stored static keys.
Implementation roadmap
- Inventory: list every extension point, every listed extension and what each can reach today. Most platforms find in-process plugins with full database access and no manifest.
- Introduce a manifest in audit mode: require scopes and egress declarations, log violations without blocking, and publish the results to authors for one release cycle.
- Enforce for new listings: new and updated extensions must pass declared-scope enforcement, egress proxying and CSP rules; existing ones get a deadline.
- Move credentials to brokering: replace pasted keys with platform-brokered OAuth, and add per-installation identities.
- Add re-approval and staged rollout: hold permission-increasing updates; release updates in rings so a hostile version reaches a small share first.
- Stand up review, scanning and the kill switch, then exercise them.
- Roll back safely: keep the previous signed version available so administrators can pin it if an update misbehaves, and make the remote disable reversible for false positives.
Framework mapping
| Control area | NIST SP 800-53 Rev. 5 | NIST CSF 2.0 | MITRE ATT&CK |
|---|---|---|---|
| Sandboxing and isolation of extension code | SC-39 Process Isolation, SC-7 Boundary Protection | PR.PS-01 | T1176 Software Extensions |
| Minimum scopes and functionality | AC-6 Least Privilege, CM-7 Least Functionality | PR.AA-05 | T1528 Steal Application Access Token |
| Marketplace and publisher assurance | SR-3 Supply Chain Controls and Processes, SR-6 Supplier Assessments and Reviews | GV.SC-07 | T1195.002 Compromise Software Supply Chain |
| Customer control of installs | CM-11 User-installed Software, SA-9 External System Services | ID.AM-02 | T1176.001, T1176.002 |
Common failure patterns
- UI checks mistaken for access control: buttons hidden for non-admins while the endpoint behind them accepts anyone. Gravity SMTP exposed API keys across WordPress sites through exactly this kind of always-true permission callback.
- Permissions granted once, forever: auto-update ships new scopes or egress without the administrator ever seeing them.
- Extensions as credential custodians: settings pages that collect API keys from users make every extension a potential key thief, as the JetBrains AI plugin campaign showed.
- Compatibility review only: the review checks that the code builds and uses supported APIs, not where data goes.
- Integration vendor as a token honeypot: refresh tokens for many tenants in one environment, as in the Salesloft Drift breach.
- No kill switch: the platform can delist an extension but cannot stop installed copies, so the response depends on every customer acting.
Practitioner checklist
- Choose sandboxed or capability-based execution for new extension models; isolate legacy in-process plugins behind least privilege host accounts.
- Require a manifest declaring scopes, egress domains, CSP relaxations and impersonation, and enforce it at runtime.
- Block permission-increasing updates until an administrator re-approves them.
- Broker API credentials through the platform; ban shared vendor-wide keys.
- Require server-side authorisation and request forgery protection on every extension endpoint, including diagnostics.
- Ban remote code loading and dynamic evaluation in extension packages.
- Verify publishers, enforce MFA on publisher accounts, sign packages and verify signatures at install.
- Scan for malware, secrets and data flows from credential fields on every publish and update.
- Log every extension action by installation, and build and test a cross-tenant remote disable.
- Give customers an allow list policy and a per-extension audit view.
Standards and references
- Atlassian: Forge security
- Atlassian: Forge manifest permissions reference
- Jenkins: Security for plugin developers
- WordPress: Common APIs Handbook, Security
- Microsoft: VS Code extension runtime security
- Google: Improve extension security (Manifest V3)
- MITRE ATT&CK: Software Extensions
- NIST: SP 800-53 Rev. 5
Related NHI Mgmt Group resources: PHP and WordPress Security Guide · Browser Extension Security Guide · AI Agent Tool and Plugin Security Guide · Atlassian Cloud Security Guide