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

Overly permissive file permissions in luigi/lock.py #3303

Closed
Ali-Razmjoo opened this issue Aug 24, 2024 · 0 comments · Fixed by #3308
Closed

Overly permissive file permissions in luigi/lock.py #3303

Ali-Razmjoo opened this issue Aug 24, 2024 · 0 comments · Fixed by #3308

Comments

@Ali-Razmjoo
Copy link
Contributor

Hi,

I am reporting a potential security with overly permissive file permissions in

https://github.com/spotify/luigi/blob/master/luigi/lock.py#L103

When creating a file, POSIX systems allow permissions to be specified for the owner, group, and others separately. Permissions should be kept as strict as possible, preventing other users from accessing the file's contents. Additionally, they can be used to write and execute malicious code for privileged escalation.

References

Ali-Razmjoo added a commit to Ali-Razmjoo/luigi that referenced this issue Sep 4, 2024
Fixes spotify#3303

Update file permissions in `luigi/lock.py` to be more restrictive.

* Change the file permissions of the `pid_dir` directory from `0o777` to `0o700` in the `acquire_for` function.
* Update the test cases `test_acquiring_partially_taken_lock` and `test_acquiring_lock_from_missing_process` in `test/lock_test.py` to check for the new file permissions `0o700`.
Ali-Razmjoo added a commit to Ali-Razmjoo/luigi that referenced this issue Sep 5, 2024
Fixes spotify#3303

Update file permissions in `luigi/lock.py` to be more restrictive.

* Change the file permissions of the `pid_dir` directory from `0o777` to `0o700` in the `acquire_for` function.
* Update the test cases `test_acquiring_partially_taken_lock` and `test_acquiring_lock_from_missing_process` in `test/lock_test.py` to check for the new file permissions `0o700`.
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

Successfully merging a pull request may close this issue.

1 participant