waku-org / nwaku

Waku node and protocol.
Other
183 stars 46 forks source link

bug: store v3 does not detect invalid cursor #2634

Closed SionoiS closed 1 week ago

SionoiS commented 3 weeks ago

@richard-ramos found this. Noted here for tracking.

Request

{"request_id":"e8f5d59a0cb3989fd908a3ae133a4fc8610926be2ccd95b0356c23d1761bc23e","return_values":true,"pubsub_topic":"/waku/2/default-waku/proto","content_topics":["test"],"time_start":1714077326654600248,"time_end":1714077326757556513,"pagination_cursor":"AQIDBAUG","pagination_forward":true,"pagination_limit":20}

Response

{"request_id":"e8f5d59a0cb3989fd908a3ae133a4fc8610926be2ccd95b0356c23d1761bc23e","status_code":200,"status_desc":"OK","messages":[{"message_hash":"mdzTZ0K3Cdc4oYdGyWKrHsxSrVGAOFe8q3VTJPUp85Y=","message":{"payload":"AQIDBAU=","contentTopic":"test","version":0,"timestamp":"1714077326654601367","meta":"","ephemeral":false,"rateLimitProof":""}},{"message_hash":"V+hJQFGftpMUofp2vsWUVuCEbg7emwn6kaONRp1sduk=","message":{"payload":"AQIDBAU=","contentTopic":"test","version":0,"timestamp":"1714077326675208887","meta":"","ephemeral":false,"rateLimitProof":""}},{"message_hash":"1kEsjM9z77NKt3tqUb2sacFDQo4Fj/4rHGCpunyZiFU=","message":{"payload":"AQIDBAU=","contentTopic":"test","version":0,"timestamp":"1714077326695847050","meta":"","ephemeral":false,"rateLimitProof":""}},{"message_hash":"302racfJCUlX+i8A3SGhIotWBmPeRMHMU6m+TDbCuX8=","message":{"payload":"AQIDBAU=","contentTopic":"test","version":0,"timestamp":"1714077326716404024","meta":"","ephemeral":false,"rateLimitProof":""}},{"message_hash":"dCR1B7q9eBNEJ0MSvdqnRbJKXY446wLsLunNVgBHFZM=","message":{"payload":"AQIDBAU=","contentTopic":"test","version":0,"timestamp":"1714077326736835722","meta":"","ephemeral":false,"rateLimitProof":""}}]}

It should reject invalid cursor like this.

Ivansete-status commented 2 weeks ago

@SionoiS - is this issue related to that one? https://github.com/waku-org/nwaku/issues/2653

SionoiS commented 2 weeks ago

@SionoiS - is this issue related to that one? #2653

This one check the length of the cursor the other if it is present in the db.