Routing key length is not validated
- Lingua principale
- C++
- Stelle
- 106
- Fork
- 32
- Merge medio
- 9h 4m
- PR unite (30g)
- 6
Descrizione
The topic exchange routing key has a limitation of 255 bytes (see https://www.rabbitmq.com/tutorials/tutorial-five-go#:~:text=There%20can%20be%20as%20many,be%20in%20the%20same%20form.). However, this limitation is not applied when binding queue to an exchange or sending the message:
**To Reproduce**
1. Specify a long routing key (>255 characters) when binging a queue to an exchange:
`topology.bind(exchange, queue, longRoutingKey);`
No errors will be reported but the process will hang forever.
2. Specify a long routing key (>255 characters) when sending the message:
`producer->send(message, longRoutingKey, ...);`
The following error will be reported:
`13JAN2025_08:46:10.559653 350290 140737331340864 WARN /home/pasick/github/pasick-clean/rmqcpp/src/rmq/rmqio/rmqio_asioconnection.cpp 410 UNINITIALIZED_LOGGER_MANAGER Socket closed: Connection reset by peer. Current state: 1`
and the connection will be closed.
Please refer to the attached sample which demonstrates the issue:
[longRoutingKeyIssue.txt](https://github.com/user-attachments/files/18396782/longRoutingKeyIssue.txt)
**Expected behavior**
I believe that the size of the routing key should be validated and do not accept values larger that 255 bytes.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Iniziate dagli entry point topology.bind(exchange, queue, longRoutingKey) e producer->send(message, longRoutingKey, ...), quindi riproducete l’esempio allegato con una chiave di routing di oltre 255 byte. Tracciate il punto in cui ogni operazione gestisce la chiave e verificate che i valori troppo grandi vengano rifiutati senza che la connessione si blocchi o venga chiusa.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- cpp, rabbitmq
- Ambito
- backend, distributed-systems
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 42/100