|
Bugzilla – Full Text Bug Listing |
| Summary: | I was able to create, but not modify, a file which was a link and 'protected' by 'NOFOLLOW' | ||
|---|---|---|---|
| Product: | Sudo | Reporter: | Jens Kristensen <kbvej145> |
| Component: | Sudo | Assignee: | Todd C. Miller <Todd.Miller> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | low | ||
| Version: | 1.8.17 | ||
| Hardware: | IBM | ||
| OS: | AIX | ||
|
Description
Jens Kristensen
2016-07-25 06:06:36 MDT
NOTE - when I try to edit a link to an existing file I get the expected result: sudoedit /apphome/current/mypasswd sudoedit: /apphome/current/mypasswd: editing symbolic links is not permitted Confirmed. This is only a problem on systems that don't support the O_NOFOLLOW flag to the open system call. There shouldn't be any security impact since sudo still won't follow a link in a writable directory by default. The issue is that the symlink check is done after the file is opened to avoid a race condition. However, when creating a new file, this means that the check doesn't happened until much later and a zero-length file is left behind as a side effect. It's not possible to fix this completely on systems that don't support O_NOFOLLOW, but the following commit adds a check before the open that will prevent it from happening in most cases. https://www.sudo.ws/repos/sudo/rev/dac04f305262 Fixed in sudo 1.8.18 |