CVE-2023-26159

7.3 HIGH

📋 TL;DR

This vulnerability in follow-redirects package allows attackers to manipulate URL parsing errors to redirect traffic to malicious sites. It affects applications using follow-redirects versions before 1.15.4 for HTTP/HTTPS requests. The vulnerability enables potential phishing attacks, information disclosure, and other security breaches.

💻 Affected Systems

Products:
  • follow-redirects npm package
Versions: All versions before 1.15.4
Operating Systems: All operating systems running Node.js applications
Default Config Vulnerable: ⚠️ Yes
Notes: Any Node.js application using follow-redirects for HTTP/HTTPS requests with user-controlled URLs is vulnerable.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete traffic hijacking to attacker-controlled servers leading to credential theft, session hijacking, and malware distribution.

🟠

Likely Case

Phishing attacks where users are redirected to malicious sites that mimic legitimate services to steal credentials.

🟢

If Mitigated

Limited impact with proper input validation and monitoring, potentially catching redirect anomalies.

🌐 Internet-Facing: HIGH - Web applications using vulnerable follow-redirects versions are directly exposed to URL manipulation attacks.
🏢 Internal Only: MEDIUM - Internal applications could be exploited if attackers gain internal network access or through supply chain attacks.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires the ability to control URL inputs to applications using follow-redirects. Public proof-of-concept demonstrates the manipulation technique.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 1.15.4 and later

Vendor Advisory: https://github.com/follow-redirects/follow-redirects/security/advisories/GHSA-74fj-2j2h-c42q

Restart Required: Yes

Instructions:

1. Update package.json to specify follow-redirects version 1.15.4 or higher. 2. Run 'npm update follow-redirects' or 'yarn upgrade follow-redirects'. 3. Restart your Node.js application. 4. Test that URL redirect functionality still works correctly.

🔧 Temporary Workarounds

Input Validation Workaround

all

Implement strict URL validation before passing to follow-redirects

// JavaScript example: Validate URLs before use
const url = require('url');
function validateURL(inputURL) {
  try {
    const parsed = new URL(inputURL);
    // Add additional validation logic here
    return parsed;
  } catch (e) {
    throw new Error('Invalid URL');
  }
}

🧯 If You Can't Patch

  • Implement strict input validation for all URL parameters before they reach follow-redirects
  • Monitor and log all redirects for anomalies, especially to unexpected domains

🔍 How to Verify

Check if Vulnerable:

Check package.json or run 'npm list follow-redirects' to see installed version. If version is below 1.15.4, you are vulnerable.

Check Version:

npm list follow-redirects | grep follow-redirects

Verify Fix Applied:

After updating, run 'npm list follow-redirects' to confirm version 1.15.4 or higher is installed. Test URL redirect functionality.

📡 Detection & Monitoring

Log Indicators:

  • Unexpected redirects to unfamiliar domains
  • URL parsing errors followed by redirects
  • Multiple failed URL validations

Network Indicators:

  • HTTP redirects to suspicious domains
  • Unusual outbound connections from application servers

SIEM Query:

source="application_logs" AND ("redirect" OR "URL.parse") AND (error OR suspicious)

🔗 References

📤 Share & Export