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

Authenticated Unrestricted File Write in letter.php #1213

Open
prodigysml opened this issue Jul 23, 2018 · 2 comments · May be fixed by #1571
Open

Authenticated Unrestricted File Write in letter.php #1213

prodigysml opened this issue Jul 23, 2018 · 2 comments · May be fixed by #1571
Labels
Web Security White Hat Reports, Cross Site SQL Injection, etc

Comments

@prodigysml
Copy link

prodigysml commented Jul 23, 2018

The Issue

Unrestricted file write vulnerabilities allow attackers to write file such as PHP files, in locations where the web server user has access to write. This may allow an attacker to write files with malicious content and may lead to remote code execution.

An attacker must be authenticated to perform this attack.

Where the Issue Occurred

The following code snippet displays the usage of the fopen function in PHP within the lh-ehr application:

$fh = fopen("$template_dir/".$_POST['newtemplatename'], 'w');

This creates or overwrites a file that the web server user has access to. The following code snippet displays writing user controlled content within the user controlled file:

if (! fwrite($fh, $temp_bodytext)) {

@tmccormi tmccormi added the Web Security White Hat Reports, Cross Site SQL Injection, etc label Sep 5, 2018
@realJema
Copy link

I will like to be assigned this issue

@muarachmann
Copy link
Member

muarachmann commented Mar 16, 2020 via email

realJema added a commit to realJema/lh-ehr that referenced this issue Mar 17, 2020
realJema added a commit to realJema/lh-ehr that referenced this issue Mar 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Web Security White Hat Reports, Cross Site SQL Injection, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants