Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
vtece4564-websockets
Advanced tools
This is a fork of the excellent websockets
library, created to facilitate use of a patched version that properly
supports the threaded WebSocketServer
implementation on Windows.
A pull request
has been submitted to the main project to incorporate the fix in the official
distribution.
Unless you're a student of Virginia Tech's ECE 4564 Network Applications Design course in Spring 2023, you almost certainly want to use the official websockets distribution. This distribution will be removed from PyPI in May 2023.
For a senior-level university network apps design course, my students are
using the threaded version of WebSocketServer
as part of their final
project. While the project required their work to run successfully in
containers on Linux, many of them use Windows for their development
workstation.
We discovered that serve_forever
throws an error at startup on Windows due
to the use of select.poll
as the means to block while waiting for incoming
socket connections. The documentation for poll
indicates that it is not
supported on all platforms, and apparently Windows is one such platform.
We patched WebSocketServer
to instead use selectors.DefaultSelector
which
determines the best supported mechanism for I/O multiplexing on the runtime
platform. The functionality is the same, but it works on a wider range of
platforms.
After switching to selectors.DefaultSelector
, we discovered that Windows
also doesn't support I/O multiplexing using pipes or files -- only sockets.
we removed the use of os.pipe
for the shutdown mechanism. It was redundant
anyway -- simply closing the listener socket in the shutdown method is
sufficient to cause the selector to return. Subsequently, the call to
socket.accept
(on the closed listener socket) causes the loop in
serve_forever
to terminate as expected.
We tested the change on Windows, Mac OS X, and a Linux container, and it seems that it correctly supports all three platforms.
FAQs
An implementation of the WebSocket Protocol (RFC 6455 & 7692)
We found that vtece4564-websockets demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.