New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cookie file permissions are narrowed when saved as a different user #12299
Comments
20f9dd6 or the CVE do not explain why :
Maybe the temporary file could be created with In |
I've pondered a bit back and forth on this and yes, I think |
What about the |
... but if we consider skipping fd = open(tempstore, O_WRONLY | O_CREAT | O_EXCL, (mode_t)sb.st_mode); |
Due to the trick where the functions rename the temp file to the target name as a last step, if the file was previously own by a different user, not ORing the old mode could otherwise end up creating a file that after xsave was not readable by the original owner. Reported-by: Loïc Yhuel Fixes #12299
See #12395 for my take on a fix. |
Because the function renames the temp file to the target name as a last step, if the file was previously owned by a different user, not ORing the old mode could otherwise end up creating a file that was no longer readable by the original owner after save. Reported-by: Loïc Yhuel Fixes #12299
Because the function renames the temp file to the target name as a last step, if the file was previously owned by a different user, not ORing the old mode could otherwise end up creating a file that was no longer readable by the original owner after save. Reported-by: Loïc Yhuel Fixes #12299 Closes #12395
Sorry for not responding earlier, I was quite busy with other work.
Unlike So to share a cookie file between users, there are several options :
In fact, 0c66718 made the non-regular file check atomic, but at the same time truncated the file with |
I did this
As
user1
:curl -c cookies.txt ...
chmod 0666 cookies.txt
As
user2
curl -c cookies.txt ...
=>
cookies.txt
mode is0600
, souser1
can no longer access it.I expected the following
cookies.txt
stays at0666
, or at least0666 & ~umask
.curl/libcurl version
curl 8.4.0-DEV (Linux) libcurl/8.4.0-DEV OpenSSL/3.0.9 zlib/1.2.13 libidn2/2.3.4 libpsl/0.21.2 (+libidn2/2.3.4)
operating system
Fedora 38
The text was updated successfully, but these errors were encountered: