Commit 9c4ea61
committed
fix: enforce polkit auth and prevent chpasswd injection
1. SetPassword now requires polkitActionUserAdministration
instead of empty action, fixing a permission bypass
2. ModifyPasswd rejects password hashes containing \n\r:
to prevent chpasswd stdin injection
Log: password change requires admin authentication
Influence:
1. non-admin user should be denied when calling DBus
SetPassword
2. password hash containing newline or colon should
return error
fix: 修改密码需鉴权并防止 chpasswd 注入
1. SetPassword 改为需要 polkitActionUserAdministration 鉴权,
修复空 action 导致的权限绕过
2. ModifyPasswd 拒绝包含 \n\r: 的密码哈希,
防止通过 chpasswd stdin 注入额外记录
Log: 修改密码需要管理员鉴权,防止未授权修改
Influence:
1. 非管理员用户尝试通过 DBus SetPassword 修改密码应被拒绝
2. 验证密码哈希包含换行或冒号时返回错误1 parent 65548c9 commit 9c4ea61
2 files changed
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
126 | | - | |
| 125 | + | |
| 126 | + | |
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
164 | 168 | | |
165 | 169 | | |
166 | 170 | | |
| |||
0 commit comments