-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[TT-15830] Plugin loading failure error is ignored for certain types of plugins #7391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
[TT-15830] Plugin loading failure error is ignored for certain types of plugins #7391
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
API Changes no api changes detected |
🔍 Code Analysis Results1. Change Impact AnalysisWhat this PR accomplishesThis pull request addresses a critical security vulnerability where the failure to load a custom plugin (gRPC, Python, or Lua) was silently ignored. Previously, if a required plugin driver was missing, the middleware would simply be disabled for the request, allowing it to proceed without executing the intended logic, such as custom authentication. This created a significant risk of bypassing security controls. The PR implements a fail-closed security posture. Now, if a configured plugin driver is not loaded at request time, the process is immediately halted, and a Key Technical ChangesThe core technical change involves relocating the plugin driver validation logic within the
Affected System Components
2. Architecture VisualizationThe following diagrams illustrate the change in the request lifecycle when a plugin driver fails to load. Before Change: Security Bypass on Plugin Load FailureThe original logic disabled the middleware but allowed the request to continue, potentially bypassing critical security checks. sequenceDiagram
participant Client
participant Tyk Gateway
participant CoProcessMiddleware
participant Upstream Service
Client->>Tyk Gateway: API Request
Tyk Gateway->>CoProcessMiddleware: EnabledForSpec()?
Note over CoProcessMiddleware: Driver not loaded, returns false
CoProcessMiddleware-->>Tyk Gateway: Middleware Disabled
Note over Tyk Gateway: Request proceeds without plugin logic
Tyk Gateway->>Upstream Service: Forwards Request (Auth Bypassed!)
Upstream Service-->>Tyk Gateway: 200 OK
Tyk Gateway-->>Client: 200 OK
After Change: Fail-Closed on Plugin Load FailureThe new logic halts the request immediately within sequenceDiagram
participant Client
participant Tyk Gateway
participant CoProcessMiddleware
participant Upstream Service
Client->>Tyk Gateway: API Request
Tyk Gateway->>CoProcessMiddleware: ProcessRequest()
Note over CoProcessMiddleware: Driver not loaded, returns error!
CoProcessMiddleware-->>Tyk Gateway: 500 Internal Server Error
Note over Tyk Gateway: Request processing is halted
Tyk Gateway-->>Client: 500 Internal Server Error
Note right of Client: Request never reaches the Upstream Service
Powered by Visor from Probelabs Last updated: 2025-10-02T13:22:43.273Z | Triggered by: synchronize | Commit: 7fcc173 |
🔍 Code Analysis ResultsSecurity Issues (2)
Performance Issues (1)
Quality Issues (1)
Style Issues (2)
Dependency Issues (2)
✅ Connectivity Check PassedNo connectivity issues found – changes LGTM. Powered by Visor from Probelabs Last updated: 2025-10-02T13:22:44.336Z | Triggered by: synchronize | Commit: 7fcc173 |
…gnored-for-certain-types-of-plugins
|
User description
TT-15830
Description
In case of gRPC, Python and Lua plugins the plugin loading failure error is ignored and the API request is still processed. This may cause unexpected behaviour as well as security issues, e.g., when Custom Plugin is chosen as an authentication method.
Related Issue
Motivation and Context
How This Has Been Tested
Screenshots (if appropriate)
Types of changes
Checklist
PR Type
Bug fix
Description
Validate driver loaded during request processing
Return 500 when driver missing
Remove premature check from enable phase
Improve logging for missing drivers
Diagram Walkthrough
File Walkthrough
coprocess.go
Move driver check to request path with 500 on failure
gateway/coprocess.go
EnabledForSpec
.ProcessRequest
start.