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
Per the docs, the onConnect server handler can be used as a form of gatekeeping if you use it to throw or returns false. This can be bypassed by simply not sending the INIT message, which means the initPromise will simply be true. Then, the client can send a GQL_START message, even if the onConnect was designed to block it.
Further considerations:
You cannot set your own headers on the client side
Potential use URL to authenticate. BEWARE: URLs can be logged and captured even through TLS/SSL
GQL_CONNECTION_ERROR is defined as a Server -> Client message. However, if an exception occurs while setting up the connection params or sending the GQL_CONNECTION_INIT - this message is sent from Client -> Server.
apollographql/subscriptions-transport-ws
The following issue collection is only up until December 2018
🚨 Possible security implications
onConnect
server handler can be used as a form of gatekeeping if you use it to throw or returns false. This can be bypassed by simply not sending theINIT
message, which means theinitPromise
will simply betrue
. Then, the client can send aGQL_START
message, even if theonConnect
was designed to block it.🛠 Issues
GQL_STOP
message is being sent from the client, after receiving theGQL_COMPLETE
message back from the server.GQL_STOP
can still be sent - causing the client to break.GQL_CONNECTION_ACK
from the server.GQL_START
is not completed before aGQL_STOP
call the client keeps receiving subscription events.GQL_CONNECTION_ERROR
is defined as a Server -> Client message. However, if an exception occurs while setting up the connection params or sending theGQL_CONNECTION_INIT
- this message is sent from Client -> Server.The text was updated successfully, but these errors were encountered: