CVE-2003-0102 (CNNVD-200303-058)

MEDIUM 有利用代码
中文标题:
file工具本地缓冲区溢出漏洞
英文标题:
Buffer overflow in tryelf() in readelf.c of the file command allows attackers to execute arbitrary c...
CVSS分数: 4.6
发布时间: 2004-09-01 04:00:00
漏洞类型: 授权问题
状态: PUBLISHED
数据质量分数: 0.40
数据版本: v5
漏洞描述
中文描述:

file(1)是一款查看文件类型的工具。 file(1)命令存在一个缓冲区溢出漏洞,本地攻击者可以利用这个漏洞以执行用户权限在系统上执行任意指令。 问题存在于readelf.c中的587行tryelf()函数的doshn()调用中: doshn(class, swap, fd, getu32(swap, elfhdr.e_shoff), getu16(swap, elfhdr.e_shnum), getu16(swap, elfhdr.e_shentsize)); doshn() 'elfhdr.e_shentsize'最后一个参数将在之后用于readelf.c 133行的read()函数中: if (read(fd, sh_addr, size) == -1) read()调用会拷贝'size'字节到readelf.c 92行定义的'sh_addr'变量中: #define sh_addr (class == ELFCLASS32 \ ? (void *) &sh32 \ : (void *) &sh64) 用于read()函数的缓冲区大小只有0x20 (32)字节,通过提供0x28 (40)字节的'size'参数可导致覆盖堆栈中的EBP和EIP寄存器而以其他用户权限执行任意代码。 用户可以构建恶意文件诱使其他用户来分析,导致发生缓冲区溢出,而以执行用户权限执行任意指令。

英文描述:

Buffer overflow in tryelf() in readelf.c of the file command allows attackers to execute arbitrary code as the user running file, possibly via a large entity size value in an ELF header (elfhdr.e_shentsize).

CWE类型:
(暂无数据)
标签:
local unix lem0n OSVDB-6456 lem0nxx
受影响产品
厂商 产品 版本 版本范围 平台 CPE
file file 3.28 - - cpe:2.3:a:file:file:3.28:*:*:*:*:*:*:*
file file 3.30 - - cpe:2.3:a:file:file:3.30:*:*:*:*:*:*:*
file file 3.32 - - cpe:2.3:a:file:file:3.32:*:*:*:*:*:*:*
file file 3.33 - - cpe:2.3:a:file:file:3.33:*:*:*:*:*:*:*
file file 3.34 - - cpe:2.3:a:file:file:3.34:*:*:*:*:*:*:*
file file 3.35 - - cpe:2.3:a:file:file:3.35:*:*:*:*:*:*:*
file file 3.36 - - cpe:2.3:a:file:file:3.36:*:*:*:*:*:*:*
file file 3.37 - - cpe:2.3:a:file:file:3.37:*:*:*:*:*:*:*
file file 3.39 - - cpe:2.3:a:file:file:3.39:*:*:*:*:*:*:*
file file 3.40 - - cpe:2.3:a:file:file:3.40:*:*:*:*:*:*:*
netbsd netbsd 1.5 - - cpe:2.3:o:netbsd:netbsd:1.5:*:*:*:*:*:*:*
netbsd netbsd 1.5.1 - - cpe:2.3:o:netbsd:netbsd:1.5.1:*:*:*:*:*:*:*
netbsd netbsd 1.5.2 - - cpe:2.3:o:netbsd:netbsd:1.5.2:*:*:*:*:*:*:*
netbsd netbsd 1.5.3 - - cpe:2.3:o:netbsd:netbsd:1.5.3:*:*:*:*:*:*:*
netbsd netbsd 1.6 - - cpe:2.3:o:netbsd:netbsd:1.6:*:*:*:*:*:*:*
解决方案
中文解决方案:
(暂无数据)
英文解决方案:
(暂无数据)
临时解决方案:
(暂无数据)
参考链接
无标题 x_refsource_MISC
cve.org
访问
file-afctr-read-bo(11469) vdb-entry
cve.org
访问
NetBSD-SA2003-003 vendor-advisory
cve.org
访问
RHSA-2003:087 vendor-advisory
cve.org
访问
SuSE-SA:2003:017 vendor-advisory
cve.org
访问
7008 vdb-entry
cve.org
访问
20030304 iDEFENSE Security Advisory 03.04.03: Locally Exploitable Buffer Overflow in file(1) mailing-list
cve.org
访问
IMNX-2003-7+-012-01 vendor-advisory
cve.org
访问
RHSA-2003:086 vendor-advisory
cve.org
访问
DSA-260 vendor-advisory
cve.org
访问
VU#611865 third-party-advisory
cve.org
访问
MDKSA-2003:030 vendor-advisory
cve.org
访问
ExploitDB EDB-22324 EXPLOIT
exploitdb
访问
Download Exploit EDB-22324 EXPLOIT
exploitdb
访问
CVE Reference: CVE-2003-0102 ADVISORY
cve.org
访问
ExploitDB EDB-22325 EXPLOIT
exploitdb
访问
Download Exploit EDB-22325 EXPLOIT
exploitdb
访问
CVSS评分详情
4.6
MEDIUM
CVSS向量: AV:L/AC:L/Au:N/C:P/I:P/A:P
CVSS版本: 2.0
机密性
PARTIAL
完整性
PARTIAL
可用性
PARTIAL
时间信息
发布时间:
2004-09-01 04:00:00
修改时间:
2024-08-08 01:43:35
创建时间:
2025-11-11 15:32:18
更新时间:
2026-01-26 02:16:47
利用信息
此漏洞有可利用代码!
利用代码数量: 2
利用来源:
未知 未知
数据源详情
数据源 记录ID 版本 提取时间
CVE cve_CVE-2003-0102 2025-11-11 15:17:26 2025-11-11 07:32:18
NVD nvd_CVE-2003-0102 2025-11-11 14:50:37 2025-11-11 07:41:04
CNNVD cnnvd_CNNVD-200303-058 2025-11-11 15:08:42 2025-11-11 07:48:50
EXPLOITDB exploitdb_EDB-22324 2025-11-11 15:05:48 2025-11-11 08:17:08
EXPLOITDB exploitdb_EDB-22325 2025-11-11 15:05:48 2025-11-11 08:17:08
版本与语言
当前版本: v5
主要语言: EN
支持语言:
EN ZH
其他标识符:
:
:
:
:
安全公告
暂无安全公告信息
变更历史
v5 EXPLOITDB
2025-11-11 16:17:08
references_count: 15 → 17; tags_count: 4 → 5
查看详细变更
  • references_count: 15 -> 17
  • tags_count: 4 -> 5
v4 EXPLOITDB
2025-11-11 16:17:08
references_count: 12 → 15; tags_count: 0 → 4; data_sources: ['cnnvd', 'cve', 'nvd'] → ['cnnvd', 'cve', 'exploitdb', 'nvd']
查看详细变更
  • references_count: 12 -> 15
  • tags_count: 0 -> 4
  • data_sources: ['cnnvd', 'cve', 'nvd'] -> ['cnnvd', 'cve', 'exploitdb', 'nvd']
v3 CNNVD
2025-11-11 15:48:50
vulnerability_type: 未提取 → 授权问题; cnnvd_id: 未提取 → CNNVD-200303-058; data_sources: ['cve', 'nvd'] → ['cnnvd', 'cve', 'nvd']
查看详细变更
  • vulnerability_type: 未提取 -> 授权问题
  • cnnvd_id: 未提取 -> CNNVD-200303-058
  • data_sources: ['cve', 'nvd'] -> ['cnnvd', 'cve', 'nvd']
v2 NVD
2025-11-11 15:41:04
cvss_score: 未提取 → 4.6; cvss_vector: NOT_EXTRACTED → AV:L/AC:L/Au:N/C:P/I:P/A:P; cvss_version: NOT_EXTRACTED → 2.0; affected_products_count: 0 → 15; data_sources: ['cve'] → ['cve', 'nvd']
查看详细变更
  • cvss_score: 未提取 -> 4.6
  • cvss_vector: NOT_EXTRACTED -> AV:L/AC:L/Au:N/C:P/I:P/A:P
  • cvss_version: NOT_EXTRACTED -> 2.0
  • affected_products_count: 0 -> 15
  • data_sources: ['cve'] -> ['cve', 'nvd']