Skip to content

CSV Injection in exported history CSV files

Moderate
thinkst-marco published GHSA-fqh6-v4qp-65fv Mar 6, 2024

Package

Canarytokens ( Docker)

Affected versions

< sha-c595a1f8

Patched versions

sha-c595a1f8

Description

Summary

Canarytokens.org supports exporting the history of a Canarytoken's incidents in CSV format. The generation of these CSV files is vulnerable to a CSV Injection vulnerability (CWE-1236). This flaw can be used by an attacker who discovers an HTTP-based Canarytoken to target the Canarytoken's owner, if the owner exports the incident history to CSV and opens in a reader application such as Microsoft Excel. The impact is that this issue could lead to code execution on the machine on which the CSV file is opened.

Details

The User-Agent header that is stored when HTTP-based Canarytokens are triggered, is copied directly into exported CSV data.

The issue can be demonstrated simply. Assume an attacker has discovered a Canarytoken link; they can run a command such as:

$ curl -kis  -H "User-Agent: =10+20+cmd|' /C calc'"'!'"A0" -kis <some-http-canarytoken-link>

Later on, when the Canarytoken owner exports the incident history as a CSV file and opens it on a Windows machine with Excel, it results in the execution of the payload (opening the calculator app in this case).

Scope of impact

The individuals impacted by this vulnerability are the owners of Canarytokens, as they are the only ones with access to export history to CSV. If they export alert logs containing the malicious payload and open them on their systems, they could inadvertently execute unauthorised commands or code such as a reverse shell for example.

Patches

This issue is now patched on Canarytokens.org.

Users of self-hosted Canarytokens installations can update by pulling the latest Docker image (or any Docker image after sha-346d25b4):

$ docker pull thinkst/canarytokens:latest

Acknowledgements

We thank @iodn for reporting this issue.

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N

CVE ID

CVE-2024-28111

Weaknesses

Credits