[asterisk-bugs] [JIRA] (ASTERISK-28949) Add masking to websocket client

Moises Silva (JIRA) noreply at issues.asterisk.org
Sat Jun 13 11:25:25 CDT 2020


Moises Silva created ASTERISK-28949:
---------------------------------------

             Summary: Add masking to websocket client
                 Key: ASTERISK-28949
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-28949
             Project: Asterisk
          Issue Type: Improvement
      Security Level: None
          Components: Resources/res_http_websocket
    Affects Versions: GIT
            Reporter: Moises Silva


The websocket client API is not performing masking. The websocket RFC 6455 mandates all frame data sent by a client to be masked (MUST).

Asterisk currently doesn't seem to use the client API at all anywhere, except for the purpose of testing the server implementation. The current server implementation does not follow RFC 6455 strictly and allows a client to send data that is not masked, instead of closing the connection as it's specified in the RFC. Not sure if you'd like to fix that, it's a simple enough check but I did not add it as it could cause broken clients out there relying on this loose behaviour.

I only found this because I'm writing a dialplan app that creates an outbound websocket connection to an upstream server and it did not work because the server closed the connection immediately with a protocol error (you can try with node.js wscat for example).

I've written a patch to fix this. I'll post the git branch next. Unfortunately in master the websocket tests were failing for me, even without my patch. I was aiming to write a test for a few masking scenarios (different payload sizes) but ran out of time for now. I'll see if I can add some during the week.

Admittedly, this improvement does not benefit anyone at the moment, but it may save time someone in the future trying to use the websocket client api.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list