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

Avoid to write linked path #14

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cosmo0920
Copy link

Currently, sigdump uses predictable path to write object dump.
But, in some circumstances, this implementation makes a vulnerability for dangling symlink attack.
And also, Kernel.open should use 0644 instead of 0666(wolrd-writable permission).
This will be also vulnerability part of dangling symlink attack.

cosmo0920 added 2 commits May 21, 2021 13:50
Fluentd usually uses predictable paths for dumping object information.

However, if systemd manages fluentd, it will send a SIGCONT to fluentd
when the managed service is stopped or restarted (see 'man systemd.kill').
Thus, if a malicious link(s) are in place in /tmp, the attack will eventually be triggered.

Signed-off-by: Hiroshi Hatake <[email protected]>
0666 is the default permission for Kernel.open.
But it shouldn't be used because we should use minimal permission.
If we use default permission for dumping target path,
dangling linked file is provided for target path which shouldn't be created
elevated parmission having file, that is, world-writable permitted
file.

Signed-off-by: Hiroshi Hatake <[email protected]>
@cosmo0920
Copy link
Author

cosmo0920 commented May 21, 2021

@frsyuki Could you kindly take a look if you have a time?
If you don't have enough time to maintain this gem, we can handle issues/PRs on @fluent-plugins-nursery:
https://github.com/fluent-plugins-nursery/contact

We think that maintainace of this gem is important for Fluentd community.

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 this pull request may close these issues.

1 participant