安全速报自动同步 · 保留上游原文

【中危】snipe-it 安全更新(GHSA-p68w-rgmg-3c2v)

S
KHack 安全情报
2026/6/24 发布 · 9 阅读

安全情报快照 · 风险级别:中危 · CVSS:6.5 · CVE-2026-49976 · GHSA-p68w-rgmg-3c2v

先看结论

snipe-it存在安全风险,< 8.6.0 受影响,建议升级至 8.6.0。

影响范围

生态 组件 受影响版本 首个修复版本
composer snipe/snipe-it < 8.6.0 8.6.0

处置建议

优先将 snipe/snipe-it 升级至 8.6.0 或更高版本;升级前请结合业务依赖完成兼容性验证。

上游技术详情(原文)

Impact

The CSV user import in update mode bypasses user-edit authorization. A user with only the import permission can overwrite any non-admin user's email by uploading a CSV, then trigger a password reset to take over the account.

UserImporter.php checks the canEditAuthFields gate and tries to strip auth fields from the model:

// app/Importer/UserImporter.php:107-114
if (Auth::check() && (! Gate::allows('canEditAuthFields', $user))) {
    unset($user->username);
    unset($user->email);
    unset($user->password);
    unset($user->activated);
}
$user->update($this->sanitizeItemForUpdating($user));

The unset()s operate on the model, but sanitizeItemForUpdating() rebuilds its array from $this->item (the raw CSV row), not from the model:

// app/Importer/ItemImporter.php:135-149
protected function sanitizeItemForStoring($model, $updating = false)
{
    $item = collect($this->item);                  // CSV data, not model attributes
    $item = $item->only($model->getFillable());
    if ($updating) {
        $item = $item->reject(fn($v) => empty($v));
    }
    return $item->toArray();
}

The attacker's CSV values pass through untouched.

For non-admin attacker vs. non-admin, non-superuser target, the gate returns true at AuthServiceProvider.php:137, so the unset() block never executes. The entire import path checks only $this->authorize('import') (ImportController.php:196); no users.edit check anywhere. The normal API route PATCH /api/v1/users/{id} correctly returns 403 for the same user.

Attacker must have import privileges to exploit this, and that permission must be granted specifically and intentionally by a superadmin.

Patches

Patched in v8.6.0

来源与许可

本页自动同步 GitHub Advisory Database 的公开数据,并保留上游原文供核验;不宣称原创分析。数据许可:CC-BY-4.0。

评论

还没有评论,来说两句。