CVE-2024-27565

9.8 CRITICAL

📋 TL;DR

This Server-Side Request Forgery (SSRF) vulnerability in the ChatGPT-wechat-personal project allows attackers to force the application to make arbitrary HTTP requests to internal or external systems. It affects deployments using the vulnerable weixin.php component, potentially exposing internal services or enabling further attacks.

💻 Affected Systems

Products:
  • ChatGPT-wechat-personal
Versions: Commit a0857f6 and potentially earlier versions
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects deployments with weixin.php component enabled and accessible

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers could access internal services, exfiltrate sensitive data, perform port scanning of internal networks, or chain with other vulnerabilities to achieve remote code execution.

🟠

Likely Case

Unauthorized access to internal HTTP services, metadata services (like AWS/Azure instance metadata), or internal APIs that shouldn't be publicly accessible.

🟢

If Mitigated

Limited to accessing only whitelisted external services with proper input validation and network segmentation in place.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

SSRF vulnerabilities are commonly exploited and weaponization is straightforward given the public PoC

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Not specified

Vendor Advisory: https://github.com/dirk1983/chatgpt-wechat-personal/issues/4

Restart Required: No

Instructions:

1. Review the GitHub issue for community patches
2. Implement proper input validation in weixin.php
3. Restrict URL schemes and destinations
4. Update to a patched version if available

🔧 Temporary Workarounds

Input Validation and Whitelisting

all

Implement strict validation of user-supplied URLs, allowing only specific domains or patterns

Modify weixin.php to validate URLs against a whitelist before processing

Network Segmentation

linux

Restrict outbound network access from the vulnerable server

iptables -A OUTPUT -p tcp --dport 80 -j DROP
iptables -A OUTPUT -p tcp --dport 443 -j DROP

🧯 If You Can't Patch

  • Implement WAF rules to block SSRF patterns in requests to weixin.php
  • Isolate the vulnerable server in a restricted network segment with no access to internal services

🔍 How to Verify

Check if Vulnerable:

Test if weixin.php accepts arbitrary URLs by sending a request with a URL parameter pointing to a controlled server

Check Version:

git log --oneline | grep a0857f6

Verify Fix Applied:

Attempt the same SSRF test and verify the request is blocked or properly validated

📡 Detection & Monitoring

Log Indicators:

  • Unusual outbound HTTP requests from the server
  • Requests to internal IP addresses or metadata services

Network Indicators:

  • HTTP traffic from server to unexpected internal/external destinations
  • Port scanning patterns from the server

SIEM Query:

source="weixin.php" AND (url CONTAINS "169.254.169.254" OR url CONTAINS "metadata.google.internal" OR url CONTAINS "localhost")

🔗 References

📤 Share & Export