Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.