fix: add docs hint for plugin override trust error#49513
Conversation
🔒 Aisle Security AnalysisWe found 1 potential security issue(s) in this PR:
1. 🔵 Information disclosure via detailed fallback override denial message (exposes internal config key path)
DescriptionThe fallback model/provider override authorization failure message for untrusted plugins now includes internal configuration structure ( This
While not a direct auth bypass, disclosing internal configuration key paths and policy names to untrusted callers can aid security policy enumeration and increase the value of error or log scraping. Vulnerable code (new detailed message): reason:
`plugin "${pluginId}" is not trusted for fallback provider/model override requests. ` +
"See https://docs.openclaw.ai/tools/plugin#runtime-helpers and search for: " +
"plugins.entries.<id>.subagent.allowModelOverride",RecommendationReturn a generic client-facing error message and keep detailed guidance for logs/debug mode only. For example: // server-plugins.ts
if (!policy?.allowModelOverride) {
// Log detailed guidance for operators
context?.logGateway?.warn(
`untrusted plugin fallback override denied: pluginId=${pluginId}; enable via plugins.entries.<id>.subagent.allowModelOverride`,
);
// Client/tool-facing message should not enumerate internal config structure
return {
allowed: false,
reason: `plugin "${pluginId}" is not trusted for fallback provider/model override requests.`,
};
}If you still want to direct operators to docs, consider using a short stable error code (e.g., Additionally, ensure any HTTP/WS error shaping avoids returning raw exception messages to untrusted clients in production (or gates detail behind a debug flag). Analyzed PR: #49513 at commit Last updated on: 2026-03-18T06:25:42Z |
Greptile SummaryThis PR improves the developer experience for the plugin fallback provider/model override trust error by appending a docs URL and the exact config key to search for, and adds a focused regression test that covers the previously-untested untrusted-plugin rejection path.
Confidence Score: 5/5
Last reviewed commit: "Gateway: add docs hi..." |
What
Update the fallback plugin provider/model override trust error so it points users at the plugin runtime docs and tells them exactly which config key to search for. Add a focused regression test for the untrusted-plugin branch.
Why
The previous error explained that the plugin was untrusted, but it did not tell operators where to find the relevant documentation or which config setting unlocks the behavior. That made the fix harder to discover from the runtime failure alone.
Changes
Testing
git diff --checkpnpm test -- src/gateway/server-plugins.test.ts -t "includes docs guidance when a plugin fallback override is not trusted"