CVE-2004-0114 (CNNVD-200403-037)
中文标题:
BSD Kernel SHMAT系统调用权限提升漏洞
英文标题:
The shmat system call in the System V Shared Memory interface for FreeBSD 5.2 and earlier, NetBSD 1....
漏洞描述
中文描述:
BSD系统中的shmat(2)函数映射一个或多个进程/线程共享内存段中,之前可通过shmget(2)函数建立。 shmat(2)系统调用存在编程错误,可导致共享内存段参考计数器错误的增长,可能造成权限提升。 这个函数在sysv_shm.c文件中实现: -- sysv_shm.c lines 317-322 -- vm_object_reference(shm_handle->shm_object); rv = vm_map_find(&p->p_vmspace->vm_map, shm_handle->shm_object, 0, &attach_va, size, (flags & MAP_FIXED) ? 0 : 1, prot, prot, 0); if (rv != KERN_SUCCESS) return ENOMEM; -- end of code snippet -- shmat(2)函数开始增加下面的vm_object的参考计数,然后尝试插入vm_object到进程地址空间。问题是由于shmat(2)函数在当vm_map_find函数返回失败时忘记递减参考计数值。 此漏洞可以被本地用户利用: 可以使用shmget(2)函数建立共享内存段,和使用shmat(2)函数在进程地址空间中建立两个不同地点的映射。 在经过大约2^32-2(非法)调用shmat(2)函数,vm_object的参考计数值会变为1。 在使用shmdt(2)函数删除一个映射后,vm_object会释放,不过我们会拥有一个额外的映射。然后利用欺骗执行一个会重用释放了的vm_object堆栈段的SUID进程,这时候就可以直接写SUID程序的堆栈段,并方便的提升权限。
英文描述:
The shmat system call in the System V Shared Memory interface for FreeBSD 5.2 and earlier, NetBSD 1.3 and earlier, and OpenBSD 2.6 and earlier, does not properly decrement a shared memory segment's reference count when the vm_map_find function fails, which could allow local users to gain read or write access to a portion of kernel memory and gain privileges.
CWE类型:
标签:
受影响产品
| 厂商 | 产品 | 版本 | 版本范围 | 平台 | CPE |
|---|---|---|---|---|---|
| freebsd | freebsd | * | - | - |
cpe:2.3:o:freebsd:freebsd:*:*:*:*:*:*:*:*
|
| netbsd | netbsd | * | - | - |
cpe:2.3:o:netbsd:netbsd:*:*:*:*:*:*:*:*
|
| openbsd | openbsd | * | - | - |
cpe:2.3:o:openbsd:openbsd:*:*:*:*:*:*:*:*
|
解决方案
中文解决方案:
英文解决方案:
临时解决方案:
参考链接
cve.org
cve.org
cve.org
cve.org
cve.org
cve.org
cve.org
cve.org
exploitdb
exploitdb
cve.org
CVSS评分详情
AV:L/AC:L/Au:N/C:P/I:P/A:P
时间信息
利用信息
数据源详情
| 数据源 | 记录ID | 版本 | 提取时间 |
|---|---|---|---|
| CVE | cve_CVE-2004-0114 |
2025-11-11 15:17:28 | 2025-11-11 07:32:20 |
| NVD | nvd_CVE-2004-0114 |
2025-11-11 14:50:54 | 2025-11-11 07:41:07 |
| CNNVD | cnnvd_CNNVD-200403-037 |
2025-11-11 15:08:43 | 2025-11-11 07:48:53 |
| EXPLOITDB | exploitdb_EDB-23655 |
2025-11-11 15:05:21 | 2025-11-11 08:19:37 |
版本与语言
安全公告
变更历史
查看详细变更
- references_count: 8 -> 11
- tags_count: 0 -> 4
- data_sources: ['cnnvd', 'cve', 'nvd'] -> ['cnnvd', 'cve', 'exploitdb', 'nvd']
查看详细变更
- vulnerability_type: 未提取 -> 授权问题
- cnnvd_id: 未提取 -> CNNVD-200403-037
- data_sources: ['cve', 'nvd'] -> ['cnnvd', '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 -> 3
- data_sources: ['cve'] -> ['cve', 'nvd']