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

推荐订阅源

D
DataBreaches.Net
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Google DeepMind News
Google DeepMind News
博客园 - 聂微东
Microsoft Azure Blog
Microsoft Azure Blog
V
Visual Studio Blog
IT之家
IT之家
博客园 - 【当耐特】
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
B
Blog
爱范儿
爱范儿
阮一峰的网络日志
阮一峰的网络日志
云风的 BLOG
云风的 BLOG
Vercel News
Vercel News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
H
Hackread – Cybersecurity News, Data Breaches, AI and More
H
Help Net Security
J
Java Code Geeks
aimingoo的专栏
aimingoo的专栏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
B
Blog RSS Feed
Blog — PlanetScale
Blog — PlanetScale
S
SegmentFault 最新的问题
Apple Machine Learning Research
Apple Machine Learning Research

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
Holes in the Safety Net: Bypassing SSRF Protection in saf...
2025-02-06 · via NodeJS Security & NodeJS Secure Coding's Blog

Can’t get enough of SSRF vulnerabilities, can we now? In this vulnerable npm package we analyze a vulnerability within safe-axios, an open-source npm package designed to safeguard applications from SSRF (Server-Side Request Forgery) attacks. While safe-axios attempts to validate URLs via a denylist, an outdated list creates a bypass window for malicious actors. Let’s explore the technical nitty-gritty and understand the potential consequences.

Demystifying safe-axios: Your (Imperfect) Shield Against SSRF

SSRF vulnerabilities emerge when an application unintentionally 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.

safe-axios aims to mitigate this risk by offering URL validation. It maintains a static denylist of IP addresses and ranges considered risky for outbound requests. If a URL resolves to an IP on this list, the request gets flagged as potentially malicious.

However, a closer look reveals a critical flaw in safe-axios’s defense mechanism.

The Vulnerability: A Stale Denylist Opens the Door

The crux of the issue lies in safe-axios’s denylist. This list, meant to identify unsafe IP addresses, is outdated or incomplete. As a result, it overlooks crucial reserved IP address spaces as defined by the IANA (Internet Assigned Numbers Authority).

Specifically, the denylist misses the following reserved ranges:

192.31.196.0/24

192.52.193.0/24

192.175.48.0/24

These ranges are typically used for multicast traffic and other special purposes within local networks. While exploiting them for SSRF attacks might be less common, it highlights a vulnerability in safe-axios’s logic.

For a more robust safety net, SSRF protection libraries should adhere to established standards for identifying invalid public IP addresses. Notably, popular npm packages like ipaddr.js correctly classify these ranges as reserved.

A Practical Demonstration of SSRF Bypass Proof of Concept (PoC)

To illustrate the bypass, let’s consider the following proof of concept example and SSRF reproducible scenario:

  1. Install the safe-axios package:
  1. Define an app.js file with the programmatic API of safe-axios:

import SafeAxios from 'safe-axios';

async function main() {

const safeAxios = SafeAxios.default;

// this request is allowed by safe axios even though it is in a reserved IP address space

const data = await safeAxios.request({url: 'https://192.32.196.4/test'});

}

main();

As you can see, safe-axios incorrectly validates a URL with a reserved IP address, potentially allowing an attacker to exploit this vulnerability.

🔥 New: Bun Security Essentials on a limited time offer for the course & book teaching you Bun security practices Bun Security Essentials

Bun Security Essentials: Mastering Bun JavaScript Security practices: supply chain security, secure coding conventions, and applied API hardening techniques.

SSRF Proof of Concept Exploit Payload

I disclosed this vulnerability to the safe-axios maintainers via a GitHub issue, and detailed this headers redirect bypass in a full security vulnerability disclosure report.