---
title: "CX-2022-5008"
date: "2022-04-28T07:00:00+00:00"
url: "https://checkmarx.com/zero/vulnerabilities/cx-2022-5008/"
---

# CX-2022-5008

[Disclosed vulnerabilities](https://checkmarx.com/zero/vulnerabilities/)

No CVE assigned  **Published:** Apr 28, 2022

7.5 High Severity log log injection logs loguru pypi python

@ @haxatron  Reported by Checkmarx Zero

Details Overview

## Summary

Improper Neutralization of Equivalent Special Elements in `loguru` can lead to Log Injection on all logging methods.  
It is possible to inject newlines (“n”) which will create a new log entry in the logfile.  
This can lead to attackers tampering with logs and a loss of integrity of the log files as a result.

## Product

`loguru` before 0.6.0.

## Impact

Users can inject logs into `loguru` via newlines.  
This affects `logger.trace`, `logger.debug`, `logger.info`, `logger.success`, `logger.warning`, `logger.error`, `logger.critical`, `logger.exception`, `logger.log` functions (9 functions in total).

## Steps to reproduce

```from
username = "Josh just logged inn2022-01-24 22:39:30.976 | INFO     | __main__:<module>:5 - User James"
logger.add("inject.log")
logger.info("User " + username + " just logged in.")
```

### Expected result:

```2022-01-24
2022-01-24 22:39:30.976 | INFO     | __main__:<module>:5 - User James just logged in.
```

## Remediation

Escape special characters (such as n and r) by default.  
Update `loguru` to version 0.6.0.

## Credit

This issue was reported by @haxatron through huntr.dev.

## Resources

1. [Disclosure](https://huntr.dev/bounties/73ebb08a-0415-41be-b9b0-0cea067f6771/)
2. [bc1dab4](https://github.com/delgan/loguru/commit/bc1dab4cc5044d704a980f5675b9d02f9f61b528)

0  High Severity CVSS v3.1 Score

   7.5

CVSS v3.1 Vectors- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: None
- Integrity Impact: High
- Availability Impact: None

Advisory Timeline1. Disclosed Jan 27, 2022

## Explore more findings

[27 Nov 2025 CVE-2025-34281  Stored Cross-Site Scripting (XSS) in ThingsBoard   6.2  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2025-34281/) [17 Jan 2025 CVE-2025-0825  HTTP Response Splitting in cpp-httplib   6.9  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2025-0825/) [17 Jun 2025 CVE-2025-6050  Stored Cross-Site Scripting (XSS) in Mezzanine CMS Admin Interface   4.8  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2025-6050/) [12 Dec 2024 CVE-2024-8374  Code Injection in UltiMaker Cura   7.8  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2024-8374/) [14 Nov 2024 CVE-2024-52526  Stored Cross-site Scripting in @LibreNMS/LibreNMS Services Tab   7.5  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2024-52526/) [14 Nov 2024 CVE-2024-51497  Stored Cross-site Scripting in @LibreNMS/LibreNMS Custom OID Tab   7.5  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2024-51497/) [14 Nov 2024 CVE-2024-51496  Reflected Cross-site Scripting in @LibreNMS/LibreNMS /wireless and /health endpoints   7.5  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2024-51496/) [  14 Nov 2024 CVE-2024-51495  Stored Cross-site Scripting in @LibreNMS/LibreNMS Device Overview `overwrite\_ip` Field   7.5  Visit the page ](https://checkmarx.com/zero/vulnerabilities/cve-2024-51495/) [14 Nov 2024 CVE-2024-51494  Stored Cross-site Scripting in @LibreNMS/LibreNMS Port Settings   7.5  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2024-51494/) [14 Nov 2024 CVE-2024-50352  Stored Cross-site Scripting in @LibreNMS/LibreNMS Services Section of Device Overview   7.5  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2024-50352/) [14 Nov 2024 CVE-2024-50351  Reflected Cross-site Scripting in @LibreNMS/LibreNMS Logs Tab   7.5  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2024-50351/) [14 Nov 2024 CVE-2024-50350  Stored Cross-site Scripting in @LibreNMS/LibreNMS Port Settings Port Group   7.5  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2024-50350/)
