y-js / y-websockets-client

Websocket connector for Yjs (Browser/Node client)
20 stars 10 forks source link

Use semver versioning for socket.io-client #5

Closed tribou closed 7 years ago

tribou commented 7 years ago

Hello @dmonad!

I ran a Node Security Project check and found that socket.io-client@1.3.7 had a list of vulnerabilities:

> nsp check
(+) 4 vulnerabilities found
┌───────────────┬───────────────────────────────────────────────────────────────┐
│               │ DoS due to excessively large websocket message                │
├───────────────┼───────────────────────────────────────────────────────────────┤
│ Name          │ ws                                                            │
├───────────────┼───────────────────────────────────────────────────────────────┤
│ CVSS          │ 7.5 (High)                                                    │
├───────────────┼───────────────────────────────────────────────────────────────┤
│ Installed     │ 0.8.0                                                         │
├───────────────┼───────────────────────────────────────────────────────────────┤
│ Vulnerable    │ <=1.1.0                                                       │
├───────────────┼───────────────────────────────────────────────────────────────┤
│ Patched       │ >=1.1.1                                                       │
├───────────────┼───────────────────────────────────────────────────────────────┤
│ Path          │ y-websockets-client@8.0.16 > socket.io-client@1.3.7 > engine… │
├───────────────┼───────────────────────────────────────────────────────────────┤
│ More Info     │ https://nodesecurity.io/advisories/120                        │
└───────────────┴───────────────────────────────────────────────────────────────┘
┌───────────────┬───────────────────────────────────────────────────────────────┐
│               │ Insecure Defaults Allow MITM Over TLS                         │
├───────────────┼───────────────────────────────────────────────────────────────┤
│ Name          │ engine.io-client                                              │
├───────────────┼───────────────────────────────────────────────────────────────┤
│ CVSS          │ 6.8 (Medium)                                                  │
├───────────────┼───────────────────────────────────────────────────────────────┤
│ Installed     │ 1.5.4                                                         │
├───────────────┼───────────────────────────────────────────────────────────────┤
│ Vulnerable    │ <= 1.6.8                                                      │
├───────────────┼───────────────────────────────────────────────────────────────┤
│ Patched       │ >= 1.6.9                                                      │
├───────────────┼───────────────────────────────────────────────────────────────┤
│ Path          │ y-websockets-client@8.0.16 > socket.io-client@1.3.7 > engine… │
├───────────────┼───────────────────────────────────────────────────────────────┤
│ More Info     │ https://nodesecurity.io/advisories/99                         │
└───────────────┴───────────────────────────────────────────────────────────────┘
┌───────────────┬───────────────────────────────────────────────────────────────┐
│               │ Remote Memory Disclosure                                      │
├───────────────┼───────────────────────────────────────────────────────────────┤
│ Name          │ ws                                                            │
├───────────────┼───────────────────────────────────────────────────────────────┤
│ CVSS          │ 6.5 (Medium)                                                  │
├───────────────┼───────────────────────────────────────────────────────────────┤
│ Installed     │ 0.8.0                                                         │
├───────────────┼───────────────────────────────────────────────────────────────┤
│ Vulnerable    │ <= 1.0.0                                                      │
├───────────────┼───────────────────────────────────────────────────────────────┤
│ Patched       │ >= 1.0.1                                                      │
├───────────────┼───────────────────────────────────────────────────────────────┤
│ Path          │ y-websockets-client@8.0.16 > socket.io-client@1.3.7 > engine… │
├───────────────┼───────────────────────────────────────────────────────────────┤
│ More Info     │ https://nodesecurity.io/advisories/67                         │
└───────────────┴───────────────────────────────────────────────────────────────┘
┌───────────────┬───────────────────────────────────────────────────────────────┐
│               │ Regular Expression Denial of Service                          │
├───────────────┼───────────────────────────────────────────────────────────────┤
│ Name          │ ms                                                            │
├───────────────┼───────────────────────────────────────────────────────────────┤
│ CVSS          │ 5.3 (Medium)                                                  │
├───────────────┼───────────────────────────────────────────────────────────────┤
│ Installed     │ 0.6.2                                                         │
├───────────────┼───────────────────────────────────────────────────────────────┤
│ Vulnerable    │ <=0.7.0                                                       │
├───────────────┼───────────────────────────────────────────────────────────────┤
│ Patched       │ >0.7.0                                                        │
├───────────────┼───────────────────────────────────────────────────────────────┤
│ Path          │ y-websockets-client@8.0.16 > socket.io-client@1.3.7 > engine… │
├───────────────┼───────────────────────────────────────────────────────────────┤
│ More Info     │ https://nodesecurity.io/advisories/46                         │
└───────────────┴───────────────────────────────────────────────────────────────┘

I wasn't sure why you pinned it to that version, but I was able to do some local tests successfully after upgrading to the latest socket.io-client@^1.

This also includes the dev dependencies needed to run the gulp dist script without depending on the yjs repo to be cloned and installed in an adjacent folder.

Let me know what you think!

dmonad commented 7 years ago

Thanks @tribou,

I wasn't aware about the security vulnerabilities. Unfortunately I have to pinpoint to an exact version because different socket.io versions (client/server) may be incompatible to each other. As I'm running a dev server, I cannot upgrade the socket.io version on either client or server.

This also includes the dev dependencies needed to run the gulp dist script without depending on the yjs repo to be cloned and installed in an adjacent folder.

I depend on my current folder structure for testing purposes. So I'd rather like to just upgrade the socket.io entry in package.json. I'm going to release a major release (including socket.io upgrade) next week.

dmonad commented 7 years ago

Your pull requests are very welcome! But I ask you to create separate pull requests for different issues (version upgrade / gulp script update). I'd have accepted the version upgrade.