You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
If application receive unformatted or invalid JSON format request as JSON-RPC request. It should validate, show the error and keep running.
Actual behavior
If application receives a request which is invalid JSON then it crashes with below error.
15:40:35 FATAL lisk-framework: System error: unhandledRejection (module=lisk:app)
Message: Unexpected end of JSON input
Trace: SyntaxError: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at Function.fromJSONRPCRequest (~/.config/yarn/global/node_modules/lisk-framework/dist-node/controller/action.js:15:72)
at ~/.config/yarn/global/node_modules/lisk-framework/dist-node/controller/bus.js:206:54
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
15:40:35 INFO lisk-framework: Application shutdown started (module=lisk:app)
{
"errorCode": 1,
"message": "Unexpected end of JSON input"
}
The same can be produced with an event as well. But since application don't receive external notifications so its safe. But application is accepting external action invocation calls so this issue can crash any application.
Steps to reproduce
Run the lisk-core with command lisk-core start --network devnet --api-ws
Or you can use any other application as well
Use this command to install a command line utility brew install websocat
Connect to the node websocat ws://localhost:8080/ws
If you see an empty prompt, means you are connected to web socket server
The prompt accepts any input that will be sent as request to server
Press new line that means we are sending empty string as request to server
This will fail the request parsing and crashes the application
Which version(s) does this affect? (Environment, OS, etc...)
5.0.0
The text was updated successfully, but these errors were encountered:
Expected behavior
If application receive unformatted or invalid JSON format request as JSON-RPC request. It should validate, show the error and keep running.
Actual behavior
If application receives a request which is invalid JSON then it crashes with below error.
The root cause of the issue is following code.
https://github.com/LiskHQ/lisk-sdk/blob/7c8644c8bdbfa84c2f14d1a658accb8cf46bb981/framework/src/controller/action.ts#L58
The same can be produced with an event as well. But since application don't receive external notifications so its safe. But application is accepting external action invocation calls so this issue can crash any application.
Steps to reproduce
lisk-core start --network devnet --api-ws
brew install websocat
websocat ws://localhost:8080/ws
Which version(s) does this affect? (Environment, OS, etc...)
5.0.0
The text was updated successfully, but these errors were encountered: