ToolResponse deliberately omits the source and the specs, but its subclass ToolUserResponse permits extra fields, and each handler built its response by spreading a full dump of the tool model. The omitted fields were re-admitted as extras and serialised back to the caller, so the schema meant to enforce the writer-only tier enforced nothing at all. The listing path carried a second, independent defect: the flag that was supposed to keep source out of listings never changed the query it guarded.
Proof of concept
Against a default instance on 0.10.2, with an admin account and a second account of role user:
As the admin, create a tool whose source contains a marker secret and share it read-only with everyone:
The same source is returned by GET /api/v1/tools/ and GET /api/v1/tools/id/poctool. On 0.11.0 the identical run returns the item with no source for the non-admin, while the owner still receives it.
Credits
bogdancherniy11-sudo — reported the disclosure across the three tool read endpoints.