You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mutates four bytes of /etc/passwd's page cache to set the running user's UID
156
+
field to "0000". /etc/passwd is world-readable on every standard Linux system,
157
+
so the *mutation* is universal. Translating it into root execution depends on
158
+
some root-side process resolving the user via getpwnam/getpwuid and acting on
159
+
the resolved uid without cross-validation. Many such consumers exist; many of
160
+
them defensively cross-check against the kernel's view of the calling uid or
161
+
against on-disk file ownership, breaking the cashout.
162
+
163
+
#### Cashout viability matrix
164
+
165
+
| Cashout | Pre-root setup needed | Notes |
166
+
|---|---|---|
167
+
| WSL2 session spawn | No | WSL's per-session `setuid(getpwnam(default_user)->pw_uid)` does no validation. Works cleanly. |
168
+
| util-linux `su`| No | Permissive caller-identity handling. |
169
+
| shadow-utils `su`| Yes |`getpwuid(getuid())` caller-identity check fails because the mutation unmaps the real uid. |
170
+
| sshd (default `StrictModes yes`) | Yes (disable StrictModes) | StrictModes requires the home dir to be owned by root or `pw->pw_uid`. Mutation makes pw_uid=0; on-disk owner stays at original uid; mismatch refuses auth. |
171
+
| MTA local delivery (postfix, exim, etc.) | Variable | Depends on the MDA's home-perm validation. Test per MTA. |
172
+
173
+
#### Pivoting after `su` fails
174
+
175
+
`exploit-passwd` execs `su <user>` after mutating, as the simplest possible
176
+
cashout. That works against util-linux `su` but fails against shadow-utils `su`
177
+
with "Cannot determine your user name." The page cache mutation is still in
178
+
place at that point, and pivoting to any other cashout (e.g. using a daemon
179
+
resolving users via getpwnam without cross-checking) is possible at that point.
180
+
Run `echo 3 > /proc/sys/vm/drop_caches` as root to clear the corrupted page
181
+
cache when done testing.
129
182
130
183
131
184
## Affected kernels
@@ -154,26 +207,6 @@ disclosure. To verify whether a target kernel is in-window, check whether
154
207
git log or the distro's changelog.
155
208
156
209
157
-
## Verification
158
-
159
-
Local cross-arch sanity check via qemu-user-static:
0 commit comments