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] Path Traversal to Remote Code Execution Vulnerability in /web/settings/saveconfig.php #2850

Closed
Yeeb1 opened this issue Oct 9, 2024 · 2 comments · Fixed by #2851

Comments

@Yeeb1
Copy link

Yeeb1 commented Oct 9, 2024

The endpoint /web/settings/saveconfig.php processes POST requests in a way that does not adequately protect against path traversal, particularly in the context of dynamically constructing command lines for execution. The vulnerability arises from the fact that user inputs ($_POST['etprovider'], $_POST['socmodul'], and $_POST['socmodul1']) are directly embedded into exec() calls without sufficient validation to ensure that the input does not lead outside of the intended directories.

image

While escapeshellcmd() is already employed to sanitize these inputs, it is primarily intended to escape shell metacharacters and does not prevent path traversal sequences such as ../../../../. This allows for the creation of inputs that effectively bypass the intended use of escapeshellcmd() and manipulate the application to execute arbitrary commands or access files outside the web root directory.

image

@Yeeb1 Yeeb1 changed the title Security Disclosure: Path Traversal to Remote Code Execution Vulnerability in /web/settings/saveconfig.php [Security] Path Traversal to Remote Code Execution Vulnerability in /web/settings/saveconfig.php Oct 9, 2024
@Yeeb1
Copy link
Author

Yeeb1 commented Oct 9, 2024

I noticed that in previous disclosures (e.g., #2816) there were discussions around responsible disclosure.

However, this repository still does not have a security policy set up (guidance here). Additionally, the contact addresses in the README.md are now pointing to openWB 2.0, which is now maintained at this repository: openWB/core.

For these reasons, I have refrained from disclosing all the details that allow for full code execution. If necessary, I can provide further details and the Python proof-of-concept (PoC).

@benderl
Copy link
Collaborator

benderl commented Oct 9, 2024

Thanks for the hint. I implemented a fix in #2851.

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

Successfully merging a pull request may close this issue.

2 participants