It does inherit the permissions from the original file - but the problem is not the swap file permissions, but the swap file location.
E.g. open /home/testuser/bin/test.sh, vim will create a swap file in /var/tmp/test.sh.swap - alas, /var/tmp is open for all users, while /home/testuser is open only for testuser. Bingo: attack vector.
- Gilboa



Reply With Quote