Skip to content

Malicious log injection via access logs

Moderate
phlax published GHSA-p222-xhp9-39rc Sep 19, 2024

Package

Envoy

Affected versions

< 1.32.0

Patched versions

1.31.2, 1.30.6, 1.29.9, 1.28.7

Description

Summary

A vulnerability has been identified in Envoy that allows malicious attackers to inject unexpected content into access logs.

This is achieved by exploiting the lack of validation for the REQUESTED_SERVER_NAME field for access loggers.

PoC

In our default access log format, the primary arbitrary input fields are headers.

REQUESTED_SERVER_NAME also can take arbitrary inputs and has no validation in Envoy at all (despite the RFC being pretty strict).

Further, this is externally exploitable as will be logged in majority of cases, even if RBAC denies.

An example exploit:

blue='\e[0;34m'
x=$(echo -e $blue)
client https://10.36.1.114/ --server-name "[foo.com](http://foo.com/)${x}this is blue
end<script>alert()</script>
[2022-01-05T17:14:26.823Z] fake log"

This has 3 in one:

  • Inject ANSI escape characters. Here it makes kubectl logs return blue text; cursor movement is also possible. Above probably only works on zsh, but others support them as well with different syntax. Cursor movement allows deleting logs, masking an attack
  • Inject HTML - I don't know of any log viewers that are subject to this, but its plausible.
  • Inject new lines, which allows inject fake logs

Impact

Log injection to our system will cause multiple unexpected problems

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
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
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:N/S:U/C:L/I:L/A:N

CVE ID

CVE-2024-45808

Weaknesses

No CWEs

Credits