mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Avoid parsing large sizes for messages
Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
@@ -225,6 +225,16 @@ func TestParsePub(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// https://www.twistlock.com/labs-blog/finding-dos-vulnerability-nats-go-fuzz-cve-2019-13126/
|
||||
func TestParsePubSizeOverflow(t *testing.T) {
|
||||
c := dummyClient()
|
||||
|
||||
pub := []byte("PUB foo 3333333333333333333333333333333333333333333333333333333333333333\r\n")
|
||||
if err := c.parse(pub); err == nil {
|
||||
t.Fatalf("Expected an error")
|
||||
}
|
||||
}
|
||||
|
||||
func TestParsePubArg(t *testing.T) {
|
||||
c := dummyClient()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user