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

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

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

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

工具目录

分类

查看所有分类
Loading categories
CVE-2024-27630 — CVE-2024–27630 Reference | Kitploit
工具/GitHubGitHub/ally-petitt/cve-2024-27630
Vulnerability AnalysisInformation GatheringWeb SecurityPenetration TestingPapers & ResearchLearning & Education
GitHubally-petitt/cve-2024-27630

CVE-2024-27630

CVE-2024–27630 Reference

查看仓库
2年前尚未审核

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

CVE-2024–27630 漏洞详情

概述

在 Savane v3.12 及更早版本中,从 /bugs/index.php 删除文件时缺少对 file_id 参数的验证,导致不安全的直接对象引用 (IDOR) 漏洞,这使得拥有错误跟踪器的组中的认证管理员可以任意删除任何错误跟踪器的文件附件,从而导致这些文件不可用。由于文件 ID 随每次新上传而递增,因此可以创建一个脚本,通过 file_id 迭代删除服务器上的所有文件附件。

CWE 分类: CWE-639:通过用户控制密钥绕过授权

报告者: Ally Petitt

受影响产品: Savane

受影响版本: 3.12 及更早版本

技术细节

负责删除错误跟踪器上文件附件的函数是 trackers_data_delete_file(),定义在下面的代码块中。

frontend/php/include/trackers/data.php:2417

root@kitploit:~
function trackers_data_delete_file ($group_id, $item_id, $file_id)
{
  global $sys_trackers_attachments_dir;
  # Make sure the attachment belongs to the group.
  $res = db_execute ("
    SELECT bug_id from " . ARTIFACT . " WHERE bug_id = ? AND group_id = ?",
    [$item_id, $group_id]
  );
  if (db_numrows ($res) <= 0)
    {
      # TRANSLATORS: the argument is item id (a number).
      $msg = sprintf (
        _("Item #%s doesn't belong to project"), $item_id
      );
      fb ($msg, 1);
      return;
    }

  $result = false;
  # Delete the attachment.
  if (unlink ("$sys_trackers_attachments_dir/$file_id")) 
    $result = db_execute ("
      DELETE FROM trackers_file WHERE item_id = ?  AND file_id = ?",
      [$item_id, $file_id]
    );

该函数首先执行一条 SQL 查询,以验证 item_id 中指定的错误 ID 所属的组,是否与攻击者所属的组(即 $group_id)相同。该函数未能检查 file_id 是否也属于同一组,这意味着只要 item_id 对应于攻击者组中的一个有效错误,攻击者就可以将 file_id 修改为指向上传目录 /var/lib/savane/trackers_attachments 中的任何文件。

此外,该函数仅对错误跟踪器管理员可用。

frontend/php/bugs/index.php:586

root@kitploit:~
  case 'delete_file':
    # Remove an attached file.
    if ($is_trackeradmin)
      {
        trackers_data_delete_file($group_id, $item_id, $item_file_id);

         # Unset previous settings and return to the item.
         $depends_search = $reassign_change_project_search = $add_cc
           = $input_file = $changed = $vfl = $details = null;
         include '../include/trackers_run/mod.php';
      }
    else
      exit_permission_denied ();
    break;

验证步骤

以下步骤演示了删除一个未授权文件的过程。但请注意,由于文件 ID 是可预测的,攻击者可以自动删除所有文件。

  1. 拥有一个对某个带有错误跟踪器的组具有管理员权限的账号(攻击者账号)。
  2. 使用另一个用户账号(受害者),在一个攻击者不是管理员的组中,为某个错误报告上传一个文件附件。上传目录的示例如下,其中文件 40231 是由受害者上传的:
root@kitploit:~
root@60ae93fe131f:/var/lib/savane/trackers_attachments# ls
40226  40227  40230  40231
  1. 访问攻击者作为管理员的组的主页。然后,访问“错误 > 浏览”,并记下表中最左列的一个有效项目 ID。该 ID 将用于下一步。

  2. 作为攻击者,向路径 /bugs/index.php?func=delete_file&item_id=<ATTACKER_ITEM_ID>&item_file_id=<FILE_ID_TO_DELETE> 发起 GET 请求。

    在我的案例中,它看起来像 http://172.17.0.2:7890/bugs/index.php?func=delete_file&item_id=50697&item_file_id=40231。

  3. 验证受害者的文件(来自攻击者没有权限的组)是否已被删除。例如:

root@kitploit:~
root@60ae93fe131f:/var/lib/savane/trackers_attachments# ls
40226  40227  40230

缓解措施

升级到 Savane 3.13 或更高版本。补丁可以在此处找到。

下载工具