Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate Checkpoint in ChangePack for PushPull API requests #805

Open
hackerwins opened this issue Mar 4, 2024 · 0 comments
Open

Validate Checkpoint in ChangePack for PushPull API requests #805

hackerwins opened this issue Mar 4, 2024 · 0 comments
Labels
enhancement 🌟 New feature or request good first issue 🐤 Good for newcomers

Comments

@hackerwins
Copy link
Member

Description:

When the Client calls the PushPull API and sends the request ChangePack, Checkpoint in the request may be tampered with due to various reasons such as network delays causing duplicate requests, new SDK bugs, or intentional tampering by malicious clients.

Therefore, it is beneficial for the stability and security of the system to validate Checkpoint.

Consider the following validation checks:

  • Changes in the request ChangePack passed to PushPull API are created by a single Client, so Change.ID.Checkpoint.ClientSeq should increment sequentially by one.
  • Checkpoint.ServerSeq in the request ChangePack for PushPull API cannot be greater than the server's Checkpoint.ServerSeq since it is set when the server saves the Change to the database.

If the Checkpoint is invalid, consider the following exception handling:

  • If duplicate requests caused by network delays treat them as OK
  • For other reasons, return INVALID_ARGUMENT

Why:

This validation will help ensure the integrity and security of the system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🌟 New feature or request good first issue 🐤 Good for newcomers
Projects
Status: Todo
Development

No branches or pull requests

1 participant