Commit 8443ab4
committed
command_matches_fnmatch: use canonicalized path if user path contains ".."
We already fall back on the canonicalized path if the user-specified
path is relative. The FNM_PATHNAME flag is already used, which
means a '/' in the user-specified command must match a '/' in the
sudoers pattern. However, there is still the potential for unintended
matches given a user-specified command path that contains "..".
For example, given a sudoers rule like:
user ALL = /usr/*/bin/*
The user would also be able to run "/bin/sh" as "sudo /usr/../bin/sh"
which is probably not what was intended.1 parent 620ba7a commit 8443ab4
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
418 | 418 | | |
419 | 419 | | |
420 | 420 | | |
421 | | - | |
| 421 | + | |
| 422 | + | |
422 | 423 | | |
423 | 424 | | |
424 | 425 | | |
| |||
0 commit comments