Skip to content

Passing an invalid namespace when connecting websocket causes a crash #1116

@awrichar

Description

@awrichar

Connecting a websocket to FireFly with an invalid namespace can cause the FireFly process to crash.

[2022-12-13T18:33:49.176Z] ERROR Sending protocol error to client: FF10187: Namespace does not exist pid=1 websocket=f66111ee-f12a-4be5-a97e-8e30e9cf6cd0
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0xbfc156]

goroutine 574 [running]:
github.com/hyperledger/firefly/internal/namespace.(*namespaceManager).Authorize(0x76892d?, {0x1093520, 0xc00089aa80}, 0xc0007782d0)
	/firefly/internal/namespace/manager.go:1136 +0x36
github.com/hyperledger/firefly/internal/events/websockets.(*websocketConnection).authorizeMessage(0xc0005032b0, {0xc00003b308, 0x11})
	/firefly/internal/events/websockets/websocket_connection.go:357 +0x11b
github.com/hyperledger/firefly/internal/events/websockets.(*websocketConnection).receiveLoop(0xc0005032b0)
	/firefly/internal/events/websockets/websocket_connection.go:160 +0x3d9
created by github.com/hyperledger/firefly/internal/events/websockets.newConnection
	/firefly/internal/events/websockets/websocket_connection.go:79 +0x36a

Metadata

Metadata

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