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

Bugfix: Limit Basic Commands to Authenticated Users #238

Merged
merged 2 commits into from
Apr 4, 2024

Conversation

lmaas
Copy link
Contributor

@lmaas lmaas commented Apr 4, 2024

This PR addresses a critical bug related to permissions checking during the processing of basic commands, where some RESP commands could be executed by unauthenticated users. Unauthenticated users should only be allowed to execute the AUTH command.

Bug Description

Steps to Reproduce

Start Garnet with password authentication enabled:

dotnet run -c Release -f net8.0 -- --auth password --password test

Connect to Garnet without authenticating and issue a common command other than AUTH (e.g. PING, GET or SET):

> PING
PONG 
> AUTH test
OK
> PING
PONG

Expected Result

> PING
(error) NOAUTH Authentication required.
> AUTH test
OK
> PING
PONG

Actual Result

Commands that are part of the basic command group are executed even when the client is not authenticated.

Changes

To fix this issue, the following changes have been made:

  • Added authentication check to ProcessBasicCommands()

@lmaas lmaas changed the title Bugfix: Limit Basic Commands to authenticated users Bugfix: Limit Basic Commands to Authenticated Users Apr 4, 2024
@lmaas lmaas merged commit 12b5b48 into microsoft:main Apr 4, 2024
21 checks passed
altall pushed a commit to altall/garnet that referenced this pull request Apr 5, 2024
* Limits basic commands to authenticated users

* Code cleanup
@github-actions github-actions bot locked and limited conversation to collaborators Jun 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants