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.
sudo-block
Advanced tools
The sudo-block npm package is designed to prevent users from running your Node.js application with superuser (sudo) privileges. This can be useful for security reasons, ensuring that your application does not inadvertently gain elevated permissions.
Preventing sudo execution
This feature prevents the execution of your Node.js application with sudo privileges. By calling `sudoBlock()`, the application will exit with an error message if it detects that it is being run with superuser privileges.
const sudoBlock = require('sudo-block');
sudoBlock();
The is-root package checks if the current process is running as the root user. Unlike sudo-block, it does not prevent execution but simply provides a boolean value indicating whether the process has root privileges. This can be useful for conditional logic based on user permissions.
Block users from running your app with root permissions
npm install sudo-block
import sudoBlock from 'sudo-block';
sudoBlock();
When a file containing this function is run with root permissions it will exit and show an error message telling the user how to fix the problem, so they don't have to run it with sudo
.
Type: string
A custom message.
FAQs
Block users from running your app with root permissions
The npm package sudo-block receives a total of 176,750 weekly downloads. As such, sudo-block popularity was classified as popular.
We found that sudo-block demonstrated a not healthy version release cadence and project activity because the last version was released 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.