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

Insecure temp file creation #95

Closed
linnea-s opened this issue Oct 2, 2019 · 7 comments · Fixed by #241
Closed

Insecure temp file creation #95

linnea-s opened this issue Oct 2, 2019 · 7 comments · Fixed by #241
Assignees
Milestone

Comments

@linnea-s
Copy link

linnea-s commented Oct 2, 2019

The sample configuration and scripts write many files to /tmp, as can be seen with fgrep -r /etc lsc. In particular bin/lsc and and etc/logback.xml, which are probably used unchanged by many users following the instructions on the website. These temporary files have known, fixed names. This is insecure and can lead to information disclosure or overwriting of files by another user on the system. See e.g. https://cwe.mitre.org/data/definitions/377.html

I suggest defaulting to writing logs to LSC_HOME, and using a secure method for creating temporary files and directories.

@coudot
Copy link
Member

coudot commented Oct 3, 2019

The log directory is already changed in packages (RPM/Debian).

It could indeed be changed in the source code.

@coudot coudot added this to the 2.1.5 milestone Oct 3, 2019
@coudot coudot modified the milestones: 2.1.5, 2.2 Feb 10, 2020
@coudot
Copy link
Member

coudot commented Feb 10, 2020

This requires changes in bin/lsc and logback.xml

@coudot
Copy link
Member

coudot commented Jul 15, 2021

Packaging files must also be updated

@davidcoutadeur
Copy link
Contributor

davidcoutadeur commented Oct 6, 2023

In debian lsc packages, I have not found in reference to tmp directory in /usr/bin/lsc, nor /etc/lsc/*
Maybe this problem is only present in source files.

@coudot
Copy link
Member

coudot commented Oct 12, 2023

Proposed solution: create a randon tmp dir (mktemp with lsc prefix) for LOG_DIR. But LOG_DIR will still be overridden in RPM and DEB.

@davidcoutadeur
Copy link
Contributor

davidcoutadeur commented Oct 19, 2023

Not so easy.

LOG_DIR in bin/lsc is used only for logging start and end of lsc run.

The main problem is to fix logback.xml:

<property name="logdir" value="/tmp/lsc/log" />

I am working on this.

@davidcoutadeur
Copy link
Contributor

Done in 77ff84b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants