Skip to content

Sensitive Cookie Without 'HttpOnly' Flag in pi-hole/adminlte

High
PromoFaux published GHSA-9hfp-j66v-6q3j Sep 17, 2021

Package

Pi-hole Web Interface (N/A)

Affected versions

<=5.5.1

Patched versions

5.6

Description

Originally Reported: https://huntr.dev/bounties/ac7fd77b-b31b-4d02-aebd-f89ecbae3fce/


POC

Enable remember me during Login

POST /admin/index.php?login HTTP/1.1
Host: 192.168.159.138
Content-Length: 30
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
Origin: http://192.168.159.138
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
Referer: http://192.168.159.138/admin/index.php?login
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Cookie: PHPSESSID=qfv8v7h8r6jrfsark4in9ia2ue
Connection: close

pw=***&persistentlogin=on
HTTP/1.1 302 Found
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Set-Cookie: PHPSESSID=***; path=/; HttpOnly
Set-Cookie: persistentlogin=***; expires=Wed, 08-Sep-2021 18:36:11 GMT; Max-Age=604800
Location: index.php
Content-type: text/html; charset=UTF-8
X-Pi-hole: The Pi-hole Web interface is working!
X-Frame-Options: DENY
Content-Length: 0
Connection: close
Date: Wed, 01 Sep 2021 18:36:11 GMT
Server: lighttpd/1.4.53

Impact

Steal cookies with XSS.

https://github.com/pi-hole/AdminLTE/blob/fb9bd561fdf936891370d85b32e899dff1dbf9d4/scripts/pi-hole/php/password.php#L82

Severity

High

CVE ID

CVE-2021-3706

Weaknesses

No CWEs