Skip to content

system/sync/top: send False of user and asversion as an empty string - #114

Open
toolonghere wants to merge 1 commit into
grommunio:masterfrom
toolonghere:sync-top-false
Open

toolonghere wants to merge 1 commit into
grommunio:masterfrom
toolonghere:sync-top-false

Conversation

@toolonghere

Copy link
Copy Markdown
Contributor

Type: bug

This pull request contains 1 change in endpoints/system/misc.py. The live sync view operates correctly when a request without authentication is in the window. It closes #91.

The problem

  • What: grommunio-sync records user and asversion as False for a request that has no authentication. The response schema accepts only a string for user, and a string or a number for asversion.
  • Effect: 1 such record in the window causes HTTP 500 for the full response. admin-web then shows an empty list.
  • Frequency: On a server that is on the internet, scanners send such requests frequently.

#91 gives more data and a curl command that shows the problem.

The change

  • syncTop() sends False in user and asversion as an empty string. The schema does not change.
  • I did not add boolean to the schema. admin-web sorts these columns with localeCompare, and a boolean value causes an error in the sort.
  • admin-web shows these fields with || '', thus the display does not change.

Test

On a test system with admin-api 1.21.53, I sent 1 ActiveSync request without an Authorization header (HTTP 401). Then I sent GET /api/v1/system/sync/top:

  • Without the change: HTTP 500, "The server generated an invalid response."
  • With the change: HTTP 200. The record has user and asversion as empty strings.

I prepared this change with an AI assistant (Claude). I examined the code and each changed line, and I did the test on a test system. Antigravity (Google's AI assistant) did an inspection of it.

grommunio-sync records user and asversion as False for a request that
has no authentication. The response schema accepts only a string for
user, and a string or a number for asversion. Thus, 1 such record in
the window causes HTTP 500 for the full response.

Send False as an empty string. admin-web shows these fields with
`|| ''`, thus the display does not change.

References: grommunio#91
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant