Plugin error boundaries
Why it matters
A plugin invocation loop without per-handler try/catch means a single third-party plugin throwing an uncaught error crashes the host, stops subsequent handlers from running, and surfaces as a 500 to every user — not just the user whose request triggered the broken plugin. CWE-755 (Improper Exception Handling) and ISO 25010 reliability.fault-tolerance both require that component failures be contained. The economic impact is proportional: one buggy plugin in an ecosystem of ten takes down applications that have nine functioning plugins installed.
Severity rationale
Critical because an unguarded hook invocation loop lets a single plugin error crash the host and stop all other plugins' handlers from executing, making application reliability contingent on the worst plugin installed.
Remediation
Wrap each handler invocation in an individual try/catch inside the loop. Log the plugin name and hook name alongside the error so operators can identify the offending plugin without a stack trace investigation.
async function invokeHook(name: string, context: HookContext): Promise<void> {
for (const { pluginName, handler } of this.getHandlers(name)) {
try {
await handler(context);
} catch (error) {
this.logger.error(`Plugin "${pluginName}" threw in hook "${name}":`, error);
this.emit('plugin:error', { pluginName, hook: name, error });
// Continue to next handler
}
}
}
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Plugin / Extension Architecture Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- iso-25010:2011 · reliability.fault-tolerance — Fault tolerance — plugin error boundaries prevent a single plugin failure from crashing the host
- cwe · CWE-755 — Improper Handling of Exceptional Conditions
Taxons
History
- 2026-04-18·v1.0.0·Initial import from plugin-extension-architecture·automated