A CRLF injection vulnerability occurs when an attacker injects a payload into an HTTP header to split the HTTP response.
To mitigate this vulnerability, validate the HTTP request url address whether it contain special characters like %0d, %0a.
To know more about the CRLF Injection - Click here
VMware Avi Load Balancer with Horizon VDI Virtual Service
Affected Version: Version lower than 22.1.6 and 30.1.x
Horizon VDI Virtual Service (MVP deployment with UAG - Avi sends 307 redirect to the client) with version lower than 22.1.6 configured with default datascript decode the CRLF in client request. This makes it vulnerable to injection attack.
Fix Version: 22.1.5-2p2, 22.1.6 and later release, 30.2.x and later release.
Workaround: Modify the default datascript functions call to not use decoded request uri.
Configure the below datascript with under Avi UI > Templates > Scripts > DataScripts > Edit: System-Standard-Horizon-UAG > "HTTP LB Done Event Script"
uag_fqdn = 'fqdn-of-vs' -- replace this variable with the site-specific UAG VS VIP FQDN for GSLB usecase
if uag_fqdn == 'fqdn-of-vs' then
uag_fqdn = avi.http.hostname()
end
avi.http.set_reqvar('uag_fqdn', uag_fqdn)
vs_port = avi.vs.port()
avi.vs.log("3332")
if vs_port == '443' then
mid_qp = avi.http.get_query("mid", false)
if mid_qp then
redirect_host = 'https://'..mid_qp.."/broker/xml"
avi.http.response(307, {location=redirect_host})
else
avi.vs.log("3333")
primary_port = avi.horizon.get_server_ports(avi.horizon.PRIMARY_PORT)
uri = avi.http.get_uri(false)
redirect_host = 'https://'..uag_fqdn..':'..primary_port
avi.http.response(307, {location=redirect_host..uri})
end
endNote: After update the System-Standard-Horizon DataScript, you won't see Header response with Site-Cookies to crlfinjection=1 and redirection works.