Skip to content

The path used for writing to TelegramException.log is a security risk #96

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

Closed
dstotijn opened this issue Feb 10, 2016 · 3 comments
Closed

Comments

@dstotijn
Copy link

The TelegramException class writes a log file TelegramException.log in the current path of the executing PHP script, because file_put_contents is called with just a filename. This can be a security risk when a public facing web server is in place, where the log file could be in the document root and can be accessed.

@noplanman
Copy link
Member

You're absolutely right, thanks for pointing this out!

An easy fix would be to restrict access to the file using .htaccess or within the nginx configuration.

Other option would be to offer the option to choose the destination of the TelegramException.log file. This would require the user to set the destination and actually make sure that it can't be accessed.

#88 Might need to be implemented after all.

Also, we'll need to add a simple .htaccess / nginx config snippet to the readme, so that users can protect themselves.

This was referenced Feb 26, 2016
@ivanbaldo
Copy link

Maybe this could be closed now?
Commit b1184d8 deals with this.

@MBoretto
Copy link
Collaborator

yes thanks!

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

No branches or pull requests

4 participants