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

Security: file inclusion issue #274

Open
Shinkurt opened this issue Jun 21, 2017 · 3 comments
Open

Security: file inclusion issue #274

Shinkurt opened this issue Jun 21, 2017 · 3 comments

Comments

@Shinkurt
Copy link

Hey,

zpanelx/modules/dns_admin/code/getbindlog.php says:

11: $bindlog = str_replace('..', '__', $_POST['inBindLog']); 
16: $handle = fopen($bindlog, "r"); 
20: fgets $buffer = fgets($handle, 4096); 

And the only mitigation to stop file inclusion is in line 5 which does to stop referencing files with path transverse like ../../file.etc
$bindlog = str_replace('..', '__', $_GET['inBindLog']);
However, this is insufficient fix because one can send payloads like .%00./.%00./file.etc as PHP before 5.3.6 truncates nullbytes and treats them as empty values letting us sneak ../../file.etc.

Fix should include null bytes or a more thought implementation.

Thanks,

@h3ct0rjs
Copy link

you can try sentora.org, is a fork o zpanel. Actually I don't know if this is a persistent bug in the fork. Could you please take a look.

Thanks,
H

@VedranIteh
Copy link

it is, and you can do even simpler attack, specify the full path instead ... eg /etc/passwd

@koshermeat
Copy link

Yes, I just looked and this seems consistent with the actual zpanel code, any authenticated user can use this bug to read any file or achieve RCE by either reading sensetive config files or system files.

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

No branches or pull requests

4 participants