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

推荐订阅源

J
Java Code Geeks
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Blog — PlanetScale
Blog — PlanetScale
G
Google Developers Blog
Microsoft Security Blog
Microsoft Security Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
腾讯CDC
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Jina AI
Jina AI
雷峰网
雷峰网
T
Tailwind CSS Blog
爱范儿
爱范儿
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
酷 壳 – CoolShell
酷 壳 – CoolShell
大猫的无限游戏
大猫的无限游戏
月光博客
月光博客
博客园 - 司徒正美
I
InfoQ
Engineering at Meta
Engineering at Meta
Vercel News
Vercel News
小众软件
小众软件
U
Unit 42
Google DeepMind News
Google DeepMind News
D
DataBreaches.Net

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 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 Vue CLI Security Fix to Mitigate NPM Binary Planting
Bypassing SSRF Safeguards in ssrfcheck: A Case of Incompl...
2025-05-10 · via NodeJS Security & NodeJS Secure Coding's Blog

Attention security professionals, another SSRF bypass for us. Today I’ll examine a vulnerability within ssrfcheck, a popular npm package designed to shield applications from SSRF (Server-Side Request Forgery) attacks. While ssrfcheck employs a denylist to identify unsafe URLs, a critical omission renders its protection incomplete (yikes!). Let’s dissect the issue and explore its technical implications.

Understanding ssrfcheck: Your (Mostly) Trusted SSRF Ally

SSRF vulnerabilities emerge when an application unwittingly makes requests to external servers based on user-controlled input. Attackers can exploit this to fetch internal resources, execute unauthorized actions, or even launch denial-of-service attacks.

ssrfcheck steps in by offering a validation layer. It maintains a denylist of IP addresses and ranges considered unsafe for outbound requests. If a provided URL resolves to an IP address on this list, the request is likely an SSRF attempt and gets flagged.

However, a closer look reveals a gap in ssrfcheck’s defense mechanism.

The Vulnerability: A Blind Spot in the Denylist

The crux of the issue lies in the way ssrfcheck constructs its denylist. While it includes various unsafe IP ranges, it overlooks a crucial category: reserved IP address spaces as defined by the IANA (Internet Assigned Numbers Authority).

Specifically, the denylist lacks the following reserved range:

224.0.0.0/4: This denotes the multicast address space, typically used for one-to-many communication on network protocols like UDP.

In real-world scenarios, exploiting this specific address space for SSRF attacks might be less common. However, the principle remains: a well-designed SSRF protection package should adhere to established standards for identifying invalid public IP addresses.

For context, other popular npm packages like ipaddr.js (often used in conjunction with SSRF protection) correctly classify the aforementioned range as reserved and not a valid public IP address.

Analyzing the Technical Landscape: Proof of Concept (PoC)

To solidify our understanding, let’s delve into a code example demonstrating the bypass:

  1. Install the ssrfcheck package:
  1. Define an app.js file with the programmatic API of ssrfcheck:

import { isSSRFSafeURL } from 'ssrfcheck';

let result

result = isSSRFSafeURL('https://012.1.2.3/whatever');

console.log(result); // returns false

result = isSSRFSafeURL('https://localhost:8080/whatever');

console.log(result); // returns false

result = isSSRFSafeURL('https://239.255.255.250:8080/whatever');

console.log(result); // returns true - bypassed

As you can observe, ssrfcheck incorrectly allows the URL with the reserved multicast IP address (239.255.255.250), potentially opening a vulnerability window.

Coordinated Security Disclosure and Next Steps

This vulnerability highlights the importance of comprehensive denylists in SSRF protection tools. Here’s what you can do:

  • Upgrade ssrfcheck: Once a patched version is released, update your packages to benefit from the fixed denylist.
  • Consider alternatives: Explore other SSRF protection libraries that offer more robust and up-to-date denylists.
  • Defense in depth: Remember, SSRF protection is a multi-layered approach. Combine validation tools with input sanitization and framework-specific security measures for optimal defense.

Hack away responsibly!