Fail closed on malformed protected list responses - #6553
Conversation
bb243d7 to
c79e33d
Compare
jhrozek
left a comment
There was a problem hiding this comment.
Reviewed the fail-closed validation added for tools/prompts/resources list responses. It correctly extends the same protection already applied to resource templates (GHSA-5vxv-9f7g-x8j2) — rejects malformed/ambiguous JSON (case-folded aliases, duplicate keys, wrong types) instead of silently passing responses through unfiltered. Field names match the MCP spec, error handling stays generic to the client, and tests cover the malformed-input cases well.
One related gap noted for a follow-up: filterFindToolResponse still does best-effort passthrough on its embedded find_tool payload, but that's pre-existing and out of scope here.
|
/retest |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6553 +/- ##
=======================================
Coverage 78.70% 78.71%
=======================================
Files 777 777
Lines 76949 76983 +34
=======================================
+ Hits 60564 60596 +32
- Misses 16380 16382 +2
Partials 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Type of change
Test plan
task test)task test-e2e)task lint-fix)Does this introduce a user-facing change?
Malformed or ambiguously encoded protected list results now return a generic internal JSON-RPC error instead of passing through unfiltered.
Implementation plan
Approved implementation plan
Special notes for reviewers
pkg/authzpackage passes within the race-enabledtask testrun. The repository-wide command currently fails only in unrelated existingpkg/plugins/pluginsvctests.task lintreports no findings in changed files; it remains non-zero because of existinggcifindings inpkg/authserver/server/provider.goandpkg/authserver/server_impl.go.