Linux /etc/shadow File Owner and Permission Check Vulnerability

漏洞信息

漏洞名称: Linux /etc/shadow File Owner and Permission Check Vulnerability

漏洞类型: 配置问题

漏洞等级: 严重

漏洞描述: 该漏洞涉及Linux系统中的/etc/shadow文件权限配置不当问题。/etc/shadow文件存储了系统中用户的密码哈希值,正常情况下应仅对root用户可读。如果该文件的权限或所有权配置不当,可能导致密码哈希值被非授权用户读取,进而引发密码破解或权限提升等安全风险。

受影响产品: Linux操作系统,广泛应用于服务器和个人计算机中,作为开源操作系统,其安全性对整个系统的稳定运行至关重要。

漏洞解释: 此漏洞属于配置问题类型,具体表现为/etc/shadow文件的权限或所有权设置不当。技术根源在于未能正确限制对敏感文件的访问权限,使得非授权用户可能读取或修改这些文件。

影响分析: 该漏洞可能导致严重的安全风险,包括但不限于密码哈希值的泄露,攻击者可以利用这些哈希值进行离线破解,进而获取系统权限。此外,如果攻击者能够修改/etc/shadow文件,还可能直接提升权限或创建后门账户。由于此漏洞涉及系统核心文件,且通常不需要用户交互即可利用,因此其危害性较高。

产品名称: Linux

来源: https://github.com/projectdiscovery/nuclei-templates/blob/1dc5e4c5a7e3689548a72d7cb2a00b803fccc824/misconfiguration%2Flinux%2Fetc-shadow-permission-check.yaml

类型: projectdiscovery/nuclei-templates:github issues

POC详情

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

id: etc-shadow-permission-check

info:
name: /etc/shadow File Owner and Permission Check
author: songyaeji
severity: critical
description: >
The /etc/shadow file must only be readable by root. If its permissions or ownership are misconfigured, it can lead to exposure of password hashes, allowing offline cracking or privilege escalation.
reference:
- https://isms.kisa.or.kr/main/csap/notice/
- Cloud Vulnerability Assessment Guide (2024) by KISA
tags: linux,local,shadow,permission,file,misconfiguration
metadata:
verified: true
os: linux
max-request: 1
classification:
cwe-id: CWE-732
cvss-metrics: CVSS:3.0/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
cvss-score: 7.4

self-contained: true

code:
- engine:
- bash
source: |
stat -c "%U %G %a" /etc/shadow 2>/dev/null || echo "not-found"
matchers:
- type: regex
part: code_1_response
regex:
- '^root\s+shadow\s+([0-3][0-9]{2}|400)$'


Linux /etc/shadow File Owner and Permission Check Vulnerability
http://example.com/2025/07/29/github_2082802763/
作者
lianccc
发布于
2025年7月29日
许可协议