Skip to content

Latest commit

 

History

History
42 lines (21 loc) · 1.59 KB

Readme.md

File metadata and controls

42 lines (21 loc) · 1.59 KB

OpenCart

Server Side Template Injection

CVE-2024-40420

Description

The openCart project v4.0.2.3 contains a server side template injection vulnerability in it's edit theme functionality, which allows an authenticated admin user to execute arbitrary system commands, resulting in remote code execution. This happens due to lack of template sandboxing and blacklisting of potentially dangerous template content.

Severity : High

CVSS Score : 8.0

CVSS Vector : AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:H/A:H

Proof Of Concept

  1. Once logged in as administrator, go to theme editor.

rce-1

  1. Click on add new

rce-2

  1. Select a page that you want to edit (login page in this case).

rce-3

  1. The theme editor uses twig template engine, meaning we can use twig template syntax payload, for starters {{7*7}}

rce-4

  1. Navigate to login page, we can see 49, indicating the code is executed.

rce-5

  1. Similarly, we can use the {{['hostname']|filter('system')}} syntax, to execute system commands.

rce-6