boostorg / boostorg/redis

Properly handle SUBSCRIBE errors

Open
#387 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
282
Forks
49
PR merge metrics
No merged PRs in 30d

Description

I've recently learned that SUBSCRIBE may error under circumstances other than a syntax error. For instance, when using ACL, the server returns an error if the user doesn't have access to the requested channels.

I think we need to improve how we handle these errors. Currently, in the best scenario, they're interpreted as pushes as put into the receive response. But if other commands are on the flight, they will be interpreted as errors to these commands, completely messing up the connection. I can see attackers somehow crafting channel names to exploit this.

I've seen that SUBSCRIBE immediately returns a push with a certain response. My proposal is attempting to identify this push (or the corresponding error), and fail the request if an error is seen.

Contributor guide

No contributing guide indexed for this repository

Research direction

Trace the SUBSCRIBE request and receive-response handling described in the issue, then reproduce an ACL-denied subscription while other commands are in flight. Done means the subscription request receives the error, subsequent command responses remain correctly associated, and the connection is not desynchronized.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, redis
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.