CVE-2022-31386
📋 TL;DR
This Server-Side Request Forgery (SSRF) vulnerability in nbnbk CMS 3 allows attackers to inject arbitrary URLs into the URL parameter of the getFileBinary function, forcing the application to make unauthorized requests to internal or external systems. This affects all installations of nbnbk CMS 3 that expose the vulnerable function, potentially allowing attackers to access internal services, perform port scanning, or interact with cloud metadata services.
💻 Affected Systems
- nbnbk CMS
📦 What is this software?
Nbnbk by Nbnbk Project
⚠️ Risk & Real-World Impact
Worst Case
Attackers could access internal services, cloud metadata endpoints (like AWS IMDS), perform port scanning of internal networks, or use the vulnerable server as a proxy for attacks against other systems, potentially leading to data exfiltration or lateral movement.
Likely Case
Attackers will use the vulnerability to scan internal networks, access internal web applications, or interact with cloud metadata services to obtain credentials and escalate privileges.
If Mitigated
With proper network segmentation and egress filtering, the impact is limited to the application server itself and any directly accessible internal services, preventing access to sensitive internal systems.
🎯 Exploit Status
The GitHub issue shows proof-of-concept exploitation. SSRF vulnerabilities are commonly weaponized due to their utility in internal network reconnaissance and cloud attacks.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: Unknown
Vendor Advisory: https://github.com/Fanli2012/nbnbk/issues/5
Restart Required: No
Instructions:
1. Check the GitHub repository for any security updates or patches. 2. If no patch is available, implement the workarounds below. 3. Consider migrating to a maintained CMS if nbnbk CMS is no longer supported.
🔧 Temporary Workarounds
Input Validation and URL Whitelisting
allImplement strict input validation on the URL parameter to only allow expected domains or patterns. Reject any URLs pointing to internal IP ranges (127.0.0.0/8, 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) or localhost.
Network Egress Filtering
allConfigure firewall rules to restrict outbound connections from the web server to only necessary external services and block access to internal network ranges.
🧯 If You Can't Patch
- Implement a Web Application Firewall (WAF) with SSRF protection rules to block malicious URL patterns.
- Disable or restrict access to the vulnerable getFileBinary function if it's not essential for application functionality.
🔍 How to Verify
Check if Vulnerable:
Test by sending a request to the vulnerable endpoint with a URL parameter pointing to an internal service (like http://127.0.0.1:22) and checking if the application attempts to connect.
Check Version:
Check the CMS version in the admin panel or configuration files. For nbnbk CMS, look for version indicators in the source code or documentation.
Verify Fix Applied:
After implementing fixes, repeat the vulnerability test to ensure the application rejects internal URLs and only allows whitelisted external domains.
📡 Detection & Monitoring
Log Indicators:
- Unusual outbound HTTP requests from the web server to internal IP addresses
- Requests to the getFileBinary function with URL parameters containing internal IPs or unusual domains
- Failed connection attempts to internal services from the web server
Network Indicators:
- HTTP traffic from web server to internal network ranges (10.x.x.x, 172.16.x.x, 192.168.x.x)
- Outbound connections to cloud metadata endpoints (169.254.169.254 for AWS)
SIEM Query:
source_ip=web_server AND dest_ip IN (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 127.0.0.0/8) AND protocol=HTTP