Skip to content

[BUG]ACLs are not working properly while setting to a specific prefix. #8152

@wajahat021

Description

@wajahat021

Describe the bug

I have set an ACL to restrict a user to a specific prefix keys.But KEYS * are showing all the keys in the redis database.

To reproduce

Step1: set 2 keys for the example

127.0.0.1:6379[190]> set apple:red fruit
127.0.0.1:6379[190]> set grape:green fruit

Step 2: set an ACL
ACL SETUSER alex on >123 ~apple:* +@all
Step 3: Login as a user and get all keys*

127.0.0.1:6379> auth alex 123
OK
127.0.0.1:6379> select 190
OK
127.0.0.1:6379[190]> KEYS *
1) "grape:green"
2) "apple:red"
127.0.0.1:6379[190]>
127.0.0.1:6379[190]> ACL WHOAMI
"alex"
```

**Expected behavior**
Only keys with a prefix of apple
```
127.0.0.1:6379[190]> KEYS *
1) "apple:red"
```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions