Skip to content
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

possible race condition when writing configuration file #161

Closed
setharnold opened this issue May 28, 2020 · 0 comments
Closed

possible race condition when writing configuration file #161

setharnold opened this issue May 28, 2020 · 0 comments

Comments

@setharnold
Copy link

Hello, I'm reviewing rtslib-fb as part of Ubuntu's main inclusion process.

I believe that the save_to_file() method may have a race condition:

with open(tmp_file, "w+") as f:

The file is created before the modes are set to restrict access. If the umask of the process is set too wide, there is a very small window where a user who has installed an inotify watch on /etc/rtslib-fb-targets may be able to open /etc/rtslib-fb-targets/saveconfig.json.temp before the modes on the file are reduced. Once opened, any secrets stored in the file can be read.

Is there a better way to report security issues? I didn't see any guidance in the README.

Thanks

pkalever pushed a commit to pkalever/rtslib-fb that referenced this issue May 28, 2020
Fixes: open-iscsi#161
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
cvubrugier pushed a commit to cvubrugier/rtslib-fb that referenced this issue May 17, 2022
Fixes: open-iscsi#161
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant