You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Found in the whole-repo pre-release review for v1.0.0rc1 (finding M1).
Problem
ExternalServiceRegister.properties.organization (cloud_registry/api/additions.openapi.yaml) has no additionalProperties: false, unlike the top level and the type schema. POST /services and PUT /services/{serviceId} both use this schema. So the nested organization object accepts any extra keys (strings of any length, nested objects, arrays), which are stored and served to everyone. Only the 1 MiB body limit caps them, so the per-field length limits documented in docs/api.md do not bound the size of a service.
With an account (e.g., via LS Login) and the per-user service limit, one user can register services with about 1 MB of extra organization data each. Every anonymous GET /services (not paged) then returns tens of MB, which can get a pod with the default 128Mi memory limit OOM-killed under a few concurrent requests, and a few dozen such accounts fill the default MongoDB volume.
Fix
Add additionalProperties: false to organization in ExternalServiceRegister.
Regression tests: an extra organization field gets 400 on POST and PUT.
Warn at startup of stored services with extra organization fields (like warn_invalid_urls()), and mention this in the upgrade notes (docs/upgrading.md) and the API docs.
Out of scope: paging or an upper bound for the services list.
Activity