CVE-2025-56263

8.8 HIGH

📋 TL;DR

CVE-2025-56263 is an arbitrary file upload vulnerability in by-night sms V1.0 that allows attackers to upload any file type and size via the /api/sms/upload/headImg endpoint. This affects all users running the vulnerable version of by-night sms software.

💻 Affected Systems

Products:
  • by-night sms
Versions: V1.0
Operating Systems: All platforms running by-night sms
Default Config Vulnerable: ⚠️ Yes
Notes: All installations of by-night sms V1.0 are vulnerable by default. No special configuration is required for exploitation.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete system compromise through remote code execution by uploading malicious scripts, leading to data theft, ransomware deployment, or creation of persistent backdoors.

🟠

Likely Case

Attackers upload web shells to gain unauthorized access, deface websites, or use the server for malicious activities like hosting phishing pages or malware distribution.

🟢

If Mitigated

Limited impact with proper file validation, restricted upload directories, and execution prevention controls in place.

🌐 Internet-Facing: HIGH - The vulnerable endpoint is accessible over the internet, allowing remote attackers to exploit it without authentication.
🏢 Internal Only: MEDIUM - Internal attackers could still exploit this, but requires network access to the vulnerable system.

🎯 Exploit Status

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

The vulnerability is trivial to exploit using standard HTTP POST requests. Public GitHub references demonstrate exploitation techniques.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Not available

Vendor Advisory: Not available

Restart Required: No

Instructions:

No official patch available. Check GitHub repository for updates or consider alternative software.

🔧 Temporary Workarounds

Web Server File Upload Restriction

all

Configure web server to block access to the vulnerable endpoint or restrict file uploads

# For Apache: Add to .htaccess or virtual host config
<Location "/api/sms/upload/headImg">
    Deny from all
</Location>
# For Nginx: Add to server block
location /api/sms/upload/headImg {
    deny all;
}

File Upload Validation

all

Implement server-side file type validation and size restrictions

# Example PHP validation snippet
$allowed_types = ['image/jpeg', 'image/png', 'image/gif'];
$max_size = 5242880; // 5MB

if (!in_array($_FILES['file']['type'], $allowed_types) || $_FILES['file']['size'] > $max_size) {
    die('Invalid file');
}

🧯 If You Can't Patch

  • Disable the /api/sms/upload/headImg endpoint completely using web server configuration or application firewall rules
  • Implement network segmentation to isolate the vulnerable system and restrict access to trusted IP addresses only

🔍 How to Verify

Check if Vulnerable:

Attempt to upload a non-image file (like test.php) to /api/sms/upload/headImg endpoint. If successful, system is vulnerable.

Check Version:

Check application configuration files or documentation for version information. No standard command available.

Verify Fix Applied:

Attempt the same upload test after applying workarounds. Upload should be rejected with proper error messages.

📡 Detection & Monitoring

Log Indicators:

  • HTTP POST requests to /api/sms/upload/headImg with non-image file extensions
  • Large file uploads to the vulnerable endpoint
  • Successful uploads of executable files (.php, .exe, .sh)

Network Indicators:

  • Unusual outbound connections from the server after file uploads
  • Traffic patterns indicating web shell communication

SIEM Query:

source="web_server_logs" AND (uri="/api/sms/upload/headImg" AND (method="POST" AND (file_extension="php" OR file_extension="exe" OR file_extension="sh")))

🔗 References

📤 Share & Export