Details
-
Bug
-
Resolution: Fixed
-
Major
-
None
-
Security Level: Public
-
None
-
CBG Sprint 102
-
1
Description
- Detected in Capella: https://couchbasecloud.atlassian.net/browse/AV-36468
- When creating a user with user name over 251 chars
- SG tries to issue a GetUser before validating len of user name
https://github.com/couchbase/sync_gateway/blob/master/db/users.go#L59
- Result is 500 instead of 400:
2022-06-27T15:50:39.529-07:00 [ERR] c:#001 #001: invalid argument | {"status_code":4,"document_id":"_sync:user:kaZRQfMw4Xzwzzvb4DKuqazXh8vhXatWv9kewt3GWbZpYmRE7MNamLgE6jjNjJPdJ6ZVRHj5f9tV7tYnAkcAgEajRjEGfWtpKh5BG59kSS7BrtdQeWUYUg4y6BpMC7Ctej56pkptuwyW32LbjREwc53pyX3YUZ5ZrLpJSnF4Yy6rVVYz7qnYEmZUhvYM8NDcNtpFnHCdxrj5XrcCkuhraE4HYmtUkDJTvFbWfDRBEtzCePQ9RHMZrU46FXW","bucket":"test01","scope":"_default","collection":"_default","error_name":"EINVAL","error_description":"Invalid packet","opaque":90,"context":"Key length exceeds 251","last_dispatched_to":"localhost:11210","last_dispatched_from":"[::1]:53369","last_connection_id":"2425bb5b7dad55e1/0894c82623726d76"} -- rest.(*handler).writeError() at handler.go:1102
|
2022-06-27T15:50:39.530-07:00 [INF] HTTP: c:#001 #001: --> 500 Internal error: invalid argument | {"status_code":4,"document_id":"_sync:user:kaZRQfMw4Xzwzzvb4DKuqazXh8vhXatWv9kewt3GWbZpYmRE7MNamLgE6jjNjJPdJ6ZVRHj5f9tV7tYnAkcAgEajRjEGfWtpKh5BG59kSS7BrtdQeWUYUg4y6BpMC7Ctej56pkptuwyW32LbjREwc53pyX3YUZ5ZrLpJSnF4Yy6rVVYz7qnYEmZUhvYM8NDcNtpFnHCdxrj5XrcCkuhraE4HYmtUkDJTvFbWfDRBEtzCePQ9RHMZrU46FXW","bucket":"test01","scope":"_default","collection":"_default","error_name":"EINVAL","error_description":"Invalid packet","opaque":90,"context":"Key length exceeds 251","last_dispatched_to":"localhost:11210","last_dispatched_from":"[::1]:53369","last_connection_id":"2425bb5b7dad55e1/0894c82623726d76"} (4.0 ms)
|