Skip to content

Instantly share code, notes, and snippets.

@ninj4c0d3r
Created May 9, 2023 18:00
Show Gist options
  • Save ninj4c0d3r/37b581eb799c8ddf97008e35d9f34469 to your computer and use it in GitHub Desktop.
Save ninj4c0d3r/37b581eb799c8ddf97008e35d9f34469 to your computer and use it in GitHub Desktop.

OcoMon < 4.0.1 - File Inclusion allow Remote Code Execution

Description

The vulnerability allows an authenticated user to change the language setting by passing a valid file path, the code will include the file and in some environments will execute malicious code.

Bug - 1

The vulnerability occurs because the function TRANS not validate and not sanitize user data entry.

image

PoC

Through Log Poisoining it was possible to obtain RCE in the application

  • Do log poisoning by inserting malicious code in PHP;

image

  • Logs:

image

  • When changing the user's language, intercept the request and in the "lang" parameter add using path traversal the directory of the log that was poisoned;

image

  • After saving the settings, when the user opens the application, the Log file will be imported and the malicious php code will be executed;

image

FIX

https://ocomonphp.sourceforge.io/downloads/

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