Linux /etc/passwd File Permission Vulnerability

漏洞信息

漏洞名称: Linux /etc/passwd File Permission Vulnerability

漏洞类型: 权限绕过

漏洞等级: 高危

漏洞描述: 该漏洞涉及Linux系统中的/etc/passwd文件权限配置不当问题。/etc/passwd文件是Linux系统中存储用户账户信息的关键文件,包括用户名、用户ID、组ID、家目录和默认shell等。正常情况下,该文件应由root用户拥有,并且权限设置为644或更严格,以防止非特权用户修改。如果该文件的权限设置不当,允许非root用户写入,攻击者可能利用此漏洞添加或修改用户账户,从而获得未经授权的shell访问权限或进行权限提升。此漏洞的技术根源在于文件权限配置错误,属于权限绕过类型。攻击者可以利用此漏洞在不需要认证的情况下,直接修改系统关键文件,可能导致系统被完全控制,数据泄露或服务中断。由于Linux系统广泛应用于服务器和嵌入式设备中,此漏洞的影响范围广泛,危害性高。

产品名称: Linux

来源: https://github.com/projectdiscovery/nuclei-templates/blob/1dc5e4c5a7e3689548a72d7cb2a00b803fccc824/misconfiguration%2Flinux%2Fetc-passwd-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-passwd-permission-check

info:
name: /etc/passwd File Owner and Permission Check
author: songyaeji
severity: high
description: >
If a user other than root can modify the /etc/passwd file, it may allow unauthorized shell access or privilege escalation. This template checks that the file is owned by root and has permission 644 or less.
reference:
- https://isms.kisa.or.kr/main/csap/notice/
- Cloud Vulnerability Assessment Guide (2024) by KISA
tags: linux,local,permission,file,passwd,compliance
metadata:
verified: true
os: linux
max-request: 1
classification:
cwe-id: CWE-732
cvss-metrics: CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
cvss-score: 7.0

self-contained: true

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


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