惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

美团技术团队
T
The Blog of Author Tim Ferriss
月光博客
月光博客
阮一峰的网络日志
阮一峰的网络日志
Engineering at Meta
Engineering at Meta
量子位
I
InfoQ
Jina AI
Jina AI
Microsoft Security Blog
Microsoft Security Blog
H
Help Net Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
G
Google Developers Blog
J
Java Code Geeks
Recent Announcements
Recent Announcements
aimingoo的专栏
aimingoo的专栏
小众软件
小众软件
V
V2EX
腾讯CDC
P
Proofpoint News Feed
A
About on SuperTechFans
爱范儿
爱范儿
U
Unit 42
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Last Week in AI
Last Week in AI

NodeJS Security & NodeJS Secure Coding's Blog

Hardening Your npm and pnpm Configs in the Age of Shai-Hulud Argument Injection vulnerability in git-blame@1.4.0 Argument Injection vulnerability in `gits@0.1.8` Command Injection vulnerability in `@fab1o/git@1.4.0` Command Injection vulnerability in `git-contributors` via unsanitized CLI arguments Command Injection vulnerability in `git-q@0.0.3` Command injection vulnerability via unsanitized CLI arguments in touxing/fast-git-clone Command Injection vulnerability in `willitmerge@0.2.1` A Directory Traversal Vulnerability I found in Mastra AI Frameworks MCP Server Mastering NPX: A Cheatsheet for npm and Node.js Power Users Mitigate Supply Chain Security with DevContainers and 1Password for Node.js Local Development The Tale of the Vulnerable MCP Database Server Bad Security Defaults in Mastra AI Frameworks Templates SQL Injection and Bypassing "Read-Only" Mode in Xata's MCP Server Security Advisory for qix npm supply-chain compromise affecting debug and billions of weekly download users How to Mitigate SQL Bypass in MCP Servers Enhancing MCP Server Security: A Guide to Using execFile Argument Injection Vulnerability in ggit How to Bypass Access Control in PostgreSQL in Simple PSQL MCP Server for SQL Injection Command Injection Flaws in ggit: Unveiling a Vulnerability Command Injection Vulnerability in Create MCP Server STDIO Tool Exposes System Monitoring Functions GitHub Kanban MCP Server Command Injection Vulnerability Threatens Developer Workflows Critical Command Injection Flaw in iOS Simulator MCP Server Exposes Development Environments Command Injection Vulnerability Discovered in Codehooks MCP Server: A Critical Security Analysis SSRF Shenanigans in safe-axios: Redirects Open the Backdoor SSRF Vulnerability in safe-axios: Unintended Public Address Classification Bypassing SSRF Safeguards in ssrfcheck: A Case of Incomplete Denylists Don't Be Fooled by Multicast, SSRF Bypass in private-ip Node.js Authentication from Lucia to Better Auth Bypassing SSRF Protection in nossrf: When Your Safeguards Become Loopholes
npm vulnerabilities: reviewing the security of your depen...
2024-05-02 · via NodeJS Security & NodeJS Secure Coding's Blog

npm packages play a crucial role in modern web development. However, finding npm vulnerabilities when you install packages is… frustrating. Still, security issues in these packages can expose your applications to security risks.

So here we are, exploring three recent npm vulnerabilities reported in popular npm packages:

1. phin - Information Exposure Through Sent Data

No CVE assigned to the security report for the phin npm package but the vulnerability details are described as:

  • Impact: Sensitive information disclosure during HTTP redirects.
  • Affected Versions: phin versions below 3.7.1

This vulnerability exists in the phin package, used for making HTTP requests. When following redirects (followRedirects is enabled), affected versions mishandle HTTP headers, potentially exposing sensitive information in outgoing requests after a redirect.

Mitigation against this type of npm vulnerabilities:

  • Upgrade phin: Update your application to use phin version 3.7.1 or later. This patched version addresses the vulnerability.
  • Consider Alternatives: Explore alternative HTTP client libraries with a well-established security track record.

2. @ladle/react - Directory Traversal

CVE-2023-25341 has been assigned to the security report for the @ladle/react npm package. The vulnerability details are described as:

  • Impact: Unauthorized file access on the server.
  • Affected Versions: @ladle/react versions below 2.5.2

This vulnerability resides in the npm package @ladle/react, a development environment for React components. Due to improper validation of user input, attackers on the same network can exploit this vulnerability to read arbitrary files accessible to the user by crafting malicious GET requests.

Mitigation strategies for this npm package’s vulnerability:

  • Upgrade @ladle/react: Update your application to use @ladle/react version 2.5.2 or later. This version includes a fix for the directory traversal vulnerability.
  • Input Validation: Implement robust input validation mechanisms within your application to sanitize user-supplied data before processing.

3. pdf-image - Command Injection

No CVE assigned to the security report for the pdf-image npm package but the vulnerability details are described as:

  • Impact: Arbitrary code execution on the server.
  • Affected Versions: All versions of pdf-image. This is considerably alarming as there are no upgrade paths available to remediate this npm vulnerability.

The pdf-image package provides functionalities for converting PDFs to images. However, all versions are vulnerable to command injection attacks due to insufficient validation of user input passed to the PDFImage function. An attacker can exploit this to execute arbitrary commands on the server.

Mitigation proposed against command injection vulnerabilities in pdf-image:

  • Avoid Untrusted Sources: Do not use pdf-image with untrusted user input or data sources.
  • Sanitize Input: Sanitize all user-supplied data before using it with pdf-image functions to remove potentially malicious commands.
  • Consider Alternatives: Explore alternative libraries for PDF to image conversion with a strong focus on secure coding practices.

Conclusion

Remember, regularly reviewing your package.json for outdated dependencies and applying security patches is crucial to maintain a secure development environment.

We reviewed some recent npm vulnerabilities disclosed in 2024 but also protecting against common Node.js vulnerabilities is as essential.

Consider using a vulnerability scanner like Snyk and integrating security best practices into your CI/CD pipeline to automate vulnerability detection and mitigation.