Join our Newsletter — 33% off our NHI Course
Home› Guides› Plugin and Extension Architecture Security Guide for SaaS…
Guide Application Security

Plugin and Extension Architecture Security Guide for SaaS Builders: Isolation, Scopes and Marketplace Controls That Hold

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 27 October 2026 15 min read
On this page

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.

ModelExample platformsWhat the extension can reachContainment strengthMain trade-off
In-process, same language runtimeWordPress plugins (PHP), Jenkins plugins (JVM)Everything the host process can: database, file system, configuration, other plugins' dataWeak: relies on author discipline and reviewMaximum flexibility; one bug or bad update compromises the host
Separate host process, same privilegesVS Code extension hostMicrosoft states extensions have the same permissions as VS Code: files, network, external processes, settingsWeak for data, stronger for stabilityProtects the UI from crashes, not the user from the extension
Platform-hosted serverless sandboxAtlassian ForgeOnly scoped product APIs and declared egress domains, through an outbound proxyStrong: isolated execution per app, separate cloud accounts from core servicesLess freedom for developers; platform must run the code
Browser extension with declared permissionsChrome Manifest V3Declared host permissions and APIs; remote code banned in extension pagesMedium to strong, depends on requested hostsBroad host permissions (all sites) cancel much of the benefit
Capability-based WebAssembly runtimeWasm plugin hosts using WASIOnly the handles (files, sockets) the host passes inStrong by designEcosystem and language support still maturing; see the WebAssembly Security Guide
Remote app over webhooks and OAuthMarketplace apps calling your public APIWhatever the granted OAuth scopes allowDepends entirely on scope design and token handlingNo 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) from external.fetch.client (the browser connect-src), and notes that a wildcard such as *.example.com does 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-eval or similar should be an explicit, reviewable manifest entry (Forge uses content.scripts and content.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 allowImpersonation and 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() and new Function() in extension pages; its content_security_policy.extension_pages key 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.

PatternHow it worksRisk if done badlyRecommended practice
Platform-brokered API callsPlatform attaches credentials to the extension's API calls; extension never sees the tokenLow; compromise is limited to the scopes and the running sessionDefault choice. Forge's managed APIs and withProvider for external OAuth providers work this way
Per-installation OAuth clientEach tenant install gets its own client or refresh tokenVendor stores many tenants' tokens; breach of the vendor exposes allShort-lived access tokens, encrypted refresh tokens, per-tenant keys, sender-constrained tokens where supported
Static API key pasted into settingsAdmin or user copies a key into the extension's configuration pageKeys leak through settings exports, debug endpoints, logs and malicious extensionsAvoid. If unavoidable, store in a secrets service, never return it to the browser, scope and cap it
Shared vendor-wide credentialOne credential used for every customerTotal cross-tenant exposureDo 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 checkPermission before any security-sensitive operation, including form validation (doCheck) and autocomplete (doAutoComplete) methods, and warns that hiding UI elements with h.hasPermission is 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 real permission_callback and admin actions need a capability check such as current_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 AccountStatusException subtype, 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.

ControlWhat it catchesExample in a live marketplace
Publisher verificationImpersonation and throwaway accountsVS Code Marketplace verified publishers prove domain ownership and six months in good standing
Publisher trust promptUnreviewed installs from unknown publishersVS Code 1.97 and later asks users to confirm trust in third-party publishers
Multi-engine malware and sandbox behaviour scanKnown malware, obvious exfiltration at runtimeVS Code Marketplace scans each package and update and runs it in a sandboxed VM
Secret scanning on publishAuthors shipping their own credentialsVS Code Marketplace blocks publication when secrets are found
Name squatting protectionLook-alike official publishersVS Code Marketplace blocks squatting on official publisher names
Package signing and install-time verificationTampering between marketplace and clientVS Code checks the Marketplace signature at install
Block list and remote uninstallExtensions confirmed malicious after releaseVS Code automatically uninstalls block-listed extensions
Data flow review of credential fieldsWorking tools that quietly exfiltrate keysThe 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.

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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

  1. 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.
  2. 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.
  3. Enforce for new listings: new and updated extensions must pass declared-scope enforcement, egress proxying and CSP rules; existing ones get a deadline.
  4. Move credentials to brokering: replace pasted keys with platform-brokered OAuth, and add per-installation identities.
  5. Add re-approval and staged rollout: hold permission-increasing updates; release updates in rings so a hostile version reaches a small share first.
  6. Stand up review, scanning and the kill switch, then exercise them.
  7. 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 areaNIST SP 800-53 Rev. 5NIST CSF 2.0MITRE ATT&CK
Sandboxing and isolation of extension codeSC-39 Process Isolation, SC-7 Boundary ProtectionPR.PS-01T1176 Software Extensions
Minimum scopes and functionalityAC-6 Least Privilege, CM-7 Least FunctionalityPR.AA-05T1528 Steal Application Access Token
Marketplace and publisher assuranceSR-3 Supply Chain Controls and Processes, SR-6 Supplier Assessments and ReviewsGV.SC-07T1195.002 Compromise Software Supply Chain
Customer control of installsCM-11 User-installed Software, SA-9 External System ServicesID.AM-02T1176.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

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

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 27 October 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.